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
| {# Set parameters for prev/next elements list #} | |
| {% set params = craft.entries.section('blog').order('title asc') %} | |
| {# Get the prev/next elements #} | |
| {% set prevEntry = entry.getPrev(params) %} | |
| {% set nextEntry = entry.getNext(params) %} | |
| {# And make sure to only output the links if the element exists #} | |
| <nav class="col"> | |
| {% if prevEntry %}<div class="nav-prev"><a href="{{ prevEntry.url }}"><i class="icomoon-chevron-left"></i> <span class="sub-title">Previous article</span> {{ prev.title }}</a></div>{% endif %} |
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
| {# Set parameters for prev/next elements list #} | |
| {% set params = craft.entries.section('blog').order('title asc') %} | |
| {# Get the prev/next elements #} | |
| {% set prevEntry = entry.getPrev(params) %} | |
| {% set nextEntry = entry.getNext(params) %} | |
| {# And make sure to only output the links if the element exists #} | |
| <nav class="col"> | |
| {% if prevEntry %}<div class="nav-prev"><a href="{{ prevEntry.url }}"><i class="icomoon-chevron-left"></i> <span class="sub-title">Previous article</span> {{ prev.title }}</a></div>{% endif %} |
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
| <?xml version="1.0"?> | |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | |
| <channel> | |
| <title>{{ siteName }}</title> | |
| <link>{{ siteUrl }}</link> | |
| <atom:link href="{{ craft.request.url }}" rel="self" type="application/rss+xml" /> | |
| <description><![CDATA[ {{ siteInfo.siteDescription }} ]]> </description> | |
| <language>fr</language> | |
| <pubDate>{{ now.rss }}</pubDate> | |
| <lastBuildDate>{{ now.rss }}</lastBuildDate> |
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
| {% block head %} | |
| {{ parent() }} | |
| <meta name="description" content="{{ entry.body | trimit(400) }}" /> | |
| <link rel="canonical" href="{{ entry.url }}"> | |
| <meta name="author" content="{{ siteName }}"> | |
| <!-- Schema.org markup for Google+ --> | |
| <meta itemprop="name" content="{{ entry.title }}"> | |
| <meta itemprop="description" content="{{ entry.body | trimit(400) }}"> | |
| <meta itemprop="image" content="{% if image %}{{ image.getUrl('large') }}{% endif %}"> |
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 %} | |
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
| <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
| 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 |
NewerOlder