Menu
Devotional Collections

You can easily create a staff directory custom collection, in three fairly easy steps:

  1. Create a custom collection form
  2. Add some data into your collection
  3. Create a custom collection page, and paste in the page code

1. Create a custom collection form

Go to Settings -> Collection Builder, and add a custom collection.

Note: it is important that you use these exact field types and names so that everything will function properly.

  1. Form Title: Devotional
  2. Add field. Type: Date. Name the field: Date (which is the default)
  3. Add field. Type: Short Answer. Name the field: Title
  4. Add field. Type: Short Answer. Name the field: Author
  5. Add field. Type: Paragraph. Name the field: Content


Before you save the form, you'll need to enter some data into the "Settings" tab:

  1. HTML Identifier: devotional
  2. Icon: your choice. I suggest: fa-lightbulb-o
  3. Singular Name: Devotional
  4. Title: None
  5. Featured image field: None
  6. API Access: None

Now, you can click the blue Save button at the bottom of your new custom collection. Notice you will also see this custom collection in your Admin sidebar. Find the new option there and select it to go to the collection.

2. Choose and import the data into your collection

Now you get to import the content for the year that has the devotional content you want to display. We have some options below. Choose one and download it. You want to download it, not view it, so you may have to right-click and choose "download linked file" to your computer. We will use this file from your computer to import it into the custom collection you just made.

On your website, you will see in the sidebar, the collection name. You already clicked on it, and there you will see a list of the items in the collection. Since you just created it, you will need to import from one of the above sample data files. Click Import, and then select the file from your computer to import. Click next, and then finish. Wait till the process completes, and then you will see the list with the data imported.

3. Create a custom collection page, and paste in the page code

Now you can decide where you want the devotional page to be. You can navigate to the parent page, and then click "Create" to make a new child page at that location.

  1. Add a new page.
  2. Choose the "Collection" page type.
  3. Select the layout you want to use for the page.
  4. Add a descriptive title like "Daily Devotional".
  5. Select the "Devotional" custom collection.
  6. Click the blue Edit field in the center of the page, and paste the code bellow into this edit area
  7. Click save.
  8. Finally, click the Publish button.
<script>
	var refTagger = {
		settings: {
			bibleVersion: "NIV",			
			roundCorners: true,
			socialSharing: ["twitter","facebook","google"]
		}
	};
	(function(d, t) {
		var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
		g.src = "//api.reftagger.com/v2/RefTagger.js";
		s.parentNode.insertBefore(g, s);
	}(document, "script"));
</script>
{% set getParamDateFormat = "Y-n-j" %}
{% set today = "now"|date(getParamDateFormat) %}
{% set devotionalDate = ( su.request.query.date ) ? su.request.query.date : today %}
{% set dateFragment = devotionalDate|date("-m-d") %}
{% set devotional = su.collection( "devotional" ).sort( "date", "desc" ).date("%"~dateFragment).limit(1).find()[0] %}
{% set displayDate = devotionalDate|date("l, F j, Y") %}

<div class="devotional">
    <h3>{{ (devotional.title) ? devotional.title : "Devotional for "~displayDate }}</h3>
    <div class="devotional-date">{{ displayDate }}<br>{% set secondsInDay = 60 * 60 * 24 %}
    {% set previousDate = ( devotionalDate|date("U") - secondsInDay )|date(getParamDateFormat) %}
    {% set nextDate = ( devotionalDate|date("U") + secondsInDay )|date(getParamDateFormat) %}
    {% set path = su.request.path|split("?")[0] %}
    {% set previousUrl = path~"?date="~previousDate %}
    {% set nextUrl = path~"?date="~nextDate %}
    <a  data-cke-saved-href="{{ previousUrl }}" href="{{ previousUrl }}">&#8678; Previous</a>
    {% if devotionalDate != today %}
     | <a  data-cke-saved-href="{{ path }}" href="{{ path }}">View Today's Devotional</a> | <a  data-cke-saved-href="{{ nextUrl }}" href="{{ nextUrl }}">Next &#8680;</a>
    {% endif %}
    </div>
    {% set hasBy = devotional.by.first or devotional.by.last %}
    {% set hasSource = devotional.source is not empty %}
    {% if hasBy or hasSource %}
        {% set byLine = (hasSource) ? "From "~devotional.source : "" %}
        {% set byIntro = (hasSource) ? " by " : "By " %}
        {% set byLine = (hasBy) ? byLine~byIntro~devotional.by.first~" "~devotional.by.last : byLine %}
        <div class="devotional-source">
            {{ byLine|raw }}
        </div>
    {% endif %}
    <br />
    <div class="devotional-content">
        {% if devotional %}
            {{ devotional.content|raw|nl2br }}
        {% else %}
            No devotional has been added for this date.
        {% endif %}
    </div>
    <br>
    <a  data-cke-saved-href="{{ previousUrl }}" href="{{ previousUrl }}">&#8678; Previous</a>
    {% if devotionalDate != today %}
     | <a  data-cke-saved-href="{{ path }}" href="{{ path }}">View Today's Devotional</a> | <a  data-cke-saved-href="{{ nextUrl }}" href="{{ nextUrl }}">Next &#8680;</a>
    {% endif %}
</div>

 

1.877.518.0819