Hi,

I am using content template and trying to theme the first teaser differently from the rest of the list. There is a variable that I can call ?
Found some solutions that need 2 separate db_querys (one for the first teaser and one for the rest of the list). There is an alternate solution for this?
Thanks in advance.

Comments

jjeff’s picture

Status: Active » Closed (works as designed)

This is probably better handled in your theme. Contemplate doesn't have any idea of context. But you could handle this in the theme's template.php file by using a static variable inside of _phptemplate_variables(). Take a look at the way this is handled in the Zengine theme engine (which would work basically the same in your theme's template.php). You can find the code around line #128 and around #224 of this file:

http://cvs.drupal.org/viewcvs/drupal/contributions/theme-engines/zengine...

This adds a "node-first" class onto the first node in a listing, but you could just as easily create a variable that you could use in your node.tpl.php file.

Whalid’s picture

Thanks jjeff!

That is exactly what I was looking for. I just changed the

if (!$node_page && $vars['count'] == 1 && !$_GET['page']) {

to

if (!$node_page && $vars['count'] == 0 && !$_GET['page']) {

to work with my current template.php. It worked like a breeze.
Thanks again