Note that there are some explanatory texts on larger screens.

plurals
  1. PODrupal Front Page Markup
    primarykey
    data
    text
    <p>I'm trying to change the markup around articles being displayed on the front page of a drupal site so I can integrate them into a slideshow. (I can't use a slideshow module). I have a page--front.tpl.php file, but I need to add more specific markup than I can do here. </p> <p>How do you go about changing the markup for just a specific area of the front page?</p> <p>I believe I need to write a preprocess hook, but I'm not sure how to target just the articles node on the front page. This is the markup I would like to have generated:</p> <pre><code>&lt;div class="slidewrap" data-autorotate="5000"&gt; &lt;ul class="slidecontrols"&gt; &lt;li&gt;&lt;a href="#sliderName" class="next"&gt;Next&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#sliderName" class="prev"&gt;Prev&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="slider" id="sliderName"&gt; &lt;li class="slide"&gt; &lt;h2 class="slidehed"&gt;First Slide&lt;/h2&gt; &lt;img src="1.jpg" /&gt; &lt;p&gt;In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien. Phasellus quis est sed turpis sollicitudin venenatis sed eu odio. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget, scelerisque a libero.&lt;/p&gt; &lt;/li&gt; &lt;li class="slide"&gt; &lt;h2 class="slidehed"&gt;&lt;a href="#"&gt;Second Slide&lt;/a&gt;&lt;/h2&gt; &lt;img src="2.jpg" /&gt; &lt;p&gt;In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien.&lt;/p&gt; &lt;/li&gt; &lt;li class="slide"&gt; &lt;h2 class="slidehed"&gt;Third Slide&lt;/h2&gt; &lt;img src="3.jpg" /&gt; &lt;p&gt;Phasellus quis est sed turpis sollicitudin venenatis sed eu odio. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget.&lt;/p&gt; &lt;/li&gt; &lt;li class="slide"&gt; &lt;h2 class="slidehed"&gt;&lt;a href="#"&gt;Fourth Slide&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien. Phasellus quis est sed turpis sollicitudin venenatis sed eu odio.&lt;/p&gt; &lt;/li&gt; &lt;li class="slide"&gt; &lt;h2 class="slidehed"&gt;Fif' Slide&lt;/h2&gt; &lt;p&gt;In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien.&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>I've been trying to do this using the views module. However, when I create a new template I get this error message: Warning: Invalid argument supplied for foreach() in include() (line 12 of /d7install/path_to_theme/views-view--featured--block.tpl.php).</p> <p>Here is the template file that I copied via the Theme Information:</p> <pre><code>&lt;?php if (!empty($title)): ?&gt; &lt;h3&gt;&lt;?php print $title; ?&gt;&lt;/h3&gt; &lt;?php endif; ?&gt; &lt;?php foreach ($rows as $id =&gt; $row): ?&gt; &lt;div class="&lt;?php print $classes_array[$id]; ?&gt;"&gt; &lt;?php print $row; ?&gt; &lt;/div&gt; &lt;?php endforeach; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload