This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# Paginate the News entries in groups of 4 #} | |
| {% paginate craft.entries.section('news').relatedTo(category).limit(4) as newsEntries %} | |
| {# Loop through this page's News entries #} | |
| {% for newsEntry in newsEntries %} | |
| {% set entryCategory = newsEntry.categories.first() %} | |
| {# Figure out where this entry should link to #} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# Paginate the News entries in groups of 4 #} | |
| {% paginate craft.entries.section('news').relatedTo(category).limit(4) as newsEntries %} | |
| {# Loop through this page's News entries #} | |
| {% for newsEntry in newsEntries %} | |
| {% set entryCategory = newsEntry.categories.first() %} | |
| {# Figure out where this entry should link to #} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% if entry.fieldHandle |length %} | |
| {{ entry.fieldHandle}} | |
| {% else %} | |
| {{ global.fieldHandle}} | |
| {% endif %} | |
| How can I conditionally display content if its a specific section? | |
| {% if entry.section.handle == 'lettings' %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How would I make a post(s) sticky so that it appears first in the results and does not repeat later in the results? | |
| You could add a custom lightswitch field or similar and order your entries by that field. | |
| {% set entries = craft.entries.section('news').order('myLightswitch desc') %} | |
| http://craftcms.stackexchange.com/questions/2149/is-there-a-sticky-post-function-built-into-craft?lq=1 | |
| http://craftcms.stackexchange.com/questions/2146/from-a-template-how-can-you-order-entries-by-one-field-and-if-that-field-is-em |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <section class="news-items"> | |
| {% for entry in craft.entries.section('news').limit(10) %} | |
| {% set image = entry.featuredImage.first() %} | |
| {% set entryCategory = entry.categories.first() %} | |
| <article class="media news-item"> | |
| <div class="media-left news-thumbnail"> | |
| <a class="" href="{{ entry.url }}"> | |
| <figure class="image_mask placeholder"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
| {% block head %} | |
| <title>{% if title is defined %}{{ title }} - {% endif %}{{ siteName }}</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for block in siteInfo.globalSiteInfo.type('description, slogan') %} | |
| {% if block.type == "description" %} <meta property="og:description" content="{{ block.siteDescription }}" /> {% endif %} | |
| {% if block.type == "slogan" %} <meta property="og:title" content="{{ block.siteMoto }}" /> {% endif %} | |
| {% endfor %} | |
OlderNewer