Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jjeff CreditAttribution: jjeff commentedThis 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.
Comment #2
Whalid CreditAttribution: Whalid commentedThanks jjeff!
That is exactly what I was looking for. I just changed the
to
to work with my current template.php. It worked like a breeze.
Thanks again