Hi there!
I'm trying to code a theme for drupal and I'm really struggling to understand how to manage the $page['content'] variable.
I have an page.tpl.php as follows ( just meaningful parts have been added ):

<div id="header">...</div>
<div id="frontrow">...</div>
<div id="wrapper">
<div id="contentHolder">
<?php render($page['content']); ?>
</div>
</div>

In the #frontrow div I need a structure as follows:

<ul class="myclass">
		<li><a href="images/img1.jpg" target="_blank"><img src="images/img1.jpg" alt=""/><div class="caption"><h2>Heading 1</h2><p>Teaser of heading 1</p></div></a></li>
		<li><a href="images/img2.jpg" target="_blank"><img src="images/img2.jpg" atl=""><div class="caption"><h2>Heading 2</h2><p>Teaser of heading 2</p></div></a></li>
	</ul>

Problem #1: I don't want to hardcode this thing in that region of my template. I'd like to have something that allows me to choose where to put my new article/base-page I just created and with my current setup it's not possible.
Problem #2: Is it possible to create such a structure with divs nested inside ul dynamically?

How could I achieve my result?

Comments

Kwb’s picture

I finally managed to achieve my desired result.
The div #frontpage was set as a region in the .info file of my theme.
Then by using Views Drupal module I easily managed to do as required: it was enough to create a new type of content and correctly set up Views.