Hello Drupal Friends,
Is it possible to theme teasers differently from the full node? If so what is the best way? I think I remember seeing a post about using a custom .tpl file of some sort, but I'm not exactly sure what I'm looking for or what to do.
Cheers,
Will
Hi Will,
how do you exactly imagine the process? You want to separate manually or user-generated teaser?
Do you want to have something like this? http://www.falanx.hu/mezei_munkara_a_hivatalnokokka
Best, Tibor
On Mon, 26 Jun 2006 19:42:15 -0400 Will Evans will@soulatomic.com wrote:
Hello Drupal Friends,
Is it possible to theme teasers differently from the full node? If so what is the best way? I think I remember seeing a post about using a custom .tpl file of some sort, but I'm not exactly sure what I'm looking for or what to do.
Cheers,
Will _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Hi, been lurking here for a while. My first post. :)
You could just check if the $teaser variable returns anything and have it spit out anything inside the conditional statement.
<?php if($teaser) { ?> <p>I'm a teaser.</p> <?php } ?>
I'm doing something similar but it's set to a class then I can control it from my style sheet.
You can read about it here.
http://www.dvessel.com/node/87
It covers a few more things too.
––––---——_–joon park ——----–––– http://www.dvessel.com ––––---—\—————————————----––––
On Jun 26, 2006, at 7:42 PM, Will Evans wrote:
Hello Drupal Friends,
Is it possible to theme teasers differently from the full node? If so what is the best way? I think I remember seeing a post about using a custom .tpl file of some sort, but I'm not exactly sure what I'm looking for or what to do.
Cheers,
Will _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Hi Joon,
Thanks for sending this and taking the time to reply. I might be a bit out of my league here, I'm very familiar with CSS once I get to that point. I understand that I need to create a custom .tpl file although I'm not sure the best way to go about that.
Would I include what you described below in the node.tpl.php file or start from scratch. I'm assuming that I would the teaser in a <div> tag and go from there?
Thanks,
Will
On Jun 26, 2006, at 8:08 PM, Joon Park wrote:
Hi, been lurking here for a while. My first post. :)
You could just check if the $teaser variable returns anything and have it spit out anything inside the conditional statement.
<?php if($teaser) { ?>
<p>I'm a teaser.</p> <?php } ?>
I'm doing something similar but it's set to a class then I can control it from my style sheet.
You can read about it here.
http://www.dvessel.com/node/87
It covers a few more things too.
Your 90% there then knowing css. You don't need a custom .tpl file. That's only useful when you want to get elaborate with different types of nodes. Teasers and the full node use the same template.
Just try this. Inside your node.tpl.php file, look for the outter most container. Most likely a <div..
Add this in there:
<div class="node<?php if($teaser) { echo ' node-teaser'; } ?>">
...your.stuff...
</div>
When it's in teaser form then it will print out:
<div class="node node-teaser">
...your.stuff...
</div>
Pretty straight forward I think. You should be able to take it from there with a selector..
.node-teaser .title { ... }
Take care,
––––---——_–joon park ——----–––– http://www.dvessel.com ––––---—\—————————————----––––
On Jun 26, 2006, at 8:29 PM, Will Evans wrote:
Hi Joon,
Thanks for sending this and taking the time to reply. I might be a bit out of my league here, I'm very familiar with CSS once I get to that point. I understand that I need to create a custom .tpl file although I'm not sure the best way to go about that.
Would I include what you described below in the node.tpl.php file or start from scratch. I'm assuming that I would the teaser in a
<div> tag and go from there?
Thanks,
Will
On Jun 26, 2006, at 8:08 PM, Joon Park wrote:
Hi, been lurking here for a while. My first post. :)
You could just check if the $teaser variable returns anything and have it spit out anything inside the conditional statement.
<?php if($teaser) { ?>
<p>I'm a teaser.</p> <?php } ?>
I'm doing something similar but it's set to a class then I can control it from my style sheet.
You can read about it here.
http://www.dvessel.com/node/87
It covers a few more things too.
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Got it. Awesome, thanks so much.
Cheers,
Will
On Jun 26, 2006, at 8:42 PM, Joon Park wrote:
Your 90% there then knowing css. You don't need a custom .tpl file. That's only useful when you want to get elaborate with different types of nodes. Teasers and the full node use the same template.
Just try this. Inside your node.tpl.php file, look for the outter most container. Most likely a <div..
Add this in there:
<div class="node<?php if($teaser) { echo ' node-teaser'; } ?>">
...your.stuff...</div>
When it's in teaser form then it will print out:
<div class="node node-teaser">
...your.stuff...</div>
Pretty straight forward I think. You should be able to take it from there with a selector..
.node-teaser .title { ... }
Take care,
––––---——_–joon park ——----–––– http://www.dvessel.com ––––---—\—————————————----––––
On Jun 26, 2006, at 8:29 PM, Will Evans wrote:
Hi Joon,
Thanks for sending this and taking the time to reply. I might be a bit out of my league here, I'm very familiar with CSS once I get to that point. I understand that I need to create a custom .tpl file although I'm not sure the best way to go about that.
Would I include what you described below in the node.tpl.php file or start from scratch. I'm assuming that I would the teaser in a
<div> tag and go from there?
Thanks,
Will
On Jun 26, 2006, at 8:08 PM, Joon Park wrote:
Hi, been lurking here for a while. My first post. :)
You could just check if the $teaser variable returns anything and have it spit out anything inside the conditional statement.
<?php if($teaser) { ?>
<p>I'm a teaser.</p> <?php } ?>
I'm doing something similar but it's set to a class then I can control it from my style sheet.
You can read about it here.
http://www.dvessel.com/node/87
It covers a few more things too.
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes