Hey guys,
composite is a great module. Unfortenatly i am having problems theming the teaser of the nodes i am including into a composite node.
Let's say that i have a content-type which is called "article". My custom teaser for this content-type is working fine on the front-page and everywhere else.
I do only show some cck-fields that i want to be shown. This is done via following php-code in node-article.tpl.php
if ($teaser):
print $node_url; "> print $node->field_blocktitel[0]['view']
print $node->field_teasertext[0]['view']
else:
[...]
endif;
Now I want to have a custom-teaser for composite only showing the cck-field "teasertext". Can anyone tell me which php if-statement I would have to use?
if ((!$teaser)&&("is part of a composite node")):
print $node->field_teasertext[0]['view']
endif;
Thanks alot,
Dieter.
Comments
Comment #1
spamwelle commentedsorry. something went wrong.
Hey guys,
composite is a great module. Unfortenatly i am having problems theming the teaser of the nodes i am including into a composite node.
Let's say that i have a content-type which is called "article". My custom teaser for this content-type is working fine on the front-page and everywhere else.
I do only show some cck-fields that i want to be shown. This is done via following php-code in node-article.tpl.php
Now I want to have a custom-teaser for composite only showing the cck-field "teasertext". Can anyone tell me which php if-statement I would have to use?
Thanks alot,
Dieter.
Comment #2
bengtan commentedHi,
If you have Composite Layout displaying a block which is displaying teasers, then there is no way to know that the teasers are within a composite layout. To display blocks, Composite just asks a block to render itself, and Composite doesn't know anything about the contents of the block.
If you have Composite Layout directly displaying nodes, then there is a variable that indicates the teasers are within a composite layout ... but this is only available in the 6.x-1.x.dev version after March 2010. For now, you'll have to try out the development snapshot.
The variable is $composite_zone and $composite_parent_nid. Please see #719340: Display as 'Body only' for more information, especially comment #9.
Comment #3
spamwelle commentedthanks alot! I will try the development snapshot.