Answers.Body: <p>Have a look at the Sections and Entries article in the official Craft documentations. It explains how to set up sections and how to configure them to load a particular template if an entry’s URL is requested. <a href="https://craftcms.com/docs/sections-and-entries" rel="nofollow">https://craftcms.com/docs/sections-and-entries</a></p>
  
  <p>Another important topic you should get yourself familiar with is how Craft’s routing mechanism works. <a href="https://craftcms.com/docs/routing" rel="nofollow">https://craftcms.com/docs/routing</a></p>
  
  <p>To configure a template for your homepage you could create a template in <code>craft/templates/index.html</code> and Craft will use it for homepage requests (routing case 4). Or you configure a section in such a way that the homepage’s URI matches one of the section entries’ URIs (routing case 6). Note that there’s also a special checkbox “This is for the homepage” available in the settings for single sections.</p>
  
  <p>With a designated template for your homepage in place, you can now add your slider code snippet to it. In the case that this template is responsible for multiple entries, e.g., entries of a structure section, you could wrap it in a conditional to check against the entry’s ID for example.</p>
  
  <pre class="lang-html prettyprint-override"><code>{% if entry.id == 12 %}
      &lt;!-- Slider code --&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-05T08:26:40.363Z
Answers.LastActivityDate: 2016-05-05T08:46:24.557Z
Answers.LastEditDate: 2016-05-05T08:46:24.557Z
Answers.UserDisplayName: carlcs
Body: <p>I am trying to figure out how to only display the slider on the homepage so that it does not show in other page. </p>
  
  <p>I am getting close but not sure what code I should write. Here is what I could think of but does not work..  </p>
  
  <pre><code>{% if slider in homepage %}
      slider goes here...
  {% endfor %}
  </code></pre>
  
  <p>I appreciate any suggestion to what the correct way of displaying content in specific page/section/entry ...</p>
  
Tags: <templating>
Title: Display sliders on homepage
ThreadText: # Display sliders on homepage
  
  (Asked by: username_0 on 2016-05-05)
  
  I am trying to figure out how to only display the slider on the homepage so that it does not show in other page.
  
  I am getting close but not sure what code I should write. Here is what I could think of but does not work..
  
  ```
  {% if slider in homepage %}
      slider goes here...
  {% endfor %}
  
  ```
  
  I appreciate any suggestion to what the correct way of displaying content in specific page/section/entry ...
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-05. Score: 2
  
  Have a look at the Sections and Entries article in the official Craft documentations. It explains how to set up sections and how to configure them to load a particular template if an entry’s URL is requested. <https://craftcms.com/docs/sections-and-entries>
  
  Another important topic you should get yourself familiar with is how Craft’s routing mechanism works. <https://craftcms.com/docs/routing>
  
  To configure a template for your homepage you could create a template in `craft/templates/index.html` and Craft will use it for homepage requests (routing case 4). Or you configure a section in such a way that the homepage’s URI matches one of the section entries’ URIs (routing case 6). Note that there’s also a special checkbox “This is for the homepage” available in the settings for single sections.
  
  With a designated template for your homepage in place, you can now add your slider code snippet to it. In the case that this template is responsible for multiple entries, e.g., entries of a structure section, you could wrap it in a conditional to check against the entry’s ID for example.
  
  ```html
  {% if entry.id == 12 %}
      <!-- Slider code -->
  {% endif %}
  
  ```
  
  
  ---
  
  