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

spamwelle’s picture

sorry. 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

<?php if ($teaser): ?>
 <h2><a href="<?php print $node_url; ?>"><?php print $node->field_blocktitel[0]['view'] ?></a></h2>
<?php print $node->field_teasertext[0]['view'] ?>
<?php else: ?>
[...]
<?php 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?

<?php if ((!$teaser)&&("is part of a composite node")): ?>
<?php print $node->field_teasertext[0]['view'] ?>
<?php endif; ?>

Thanks alot,
Dieter.

bengtan’s picture

Status: Active » Fixed

Hi,

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.

spamwelle’s picture

thanks alot! I will try the development snapshot.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.