I have a specific piece of code that I would like to show up only when viewing an article after clicking on read more (ie: not in teaser view, in page view only) and I'm not sure how / where to insert this.

Can someone point me in the right direction?

Comments

Cayhn’s picture

You could perhaps do it like this, anyway this is how I do it:

In the node.tpl.php file you will have to find the line that says print $content;
Depending on where you want your banner to show you add your code like this:

 <?php print $content  ?>

<?php if ($page == 1): ?>
//Or here if you want it beneath the content
<?php endif; ?>
cmscritic’s picture

Thank you, that works.

holger’s picture

I am looking for a solution to display a block (block id=1) between the teaser-text and the content in the page view.

Would you show me what changes are need to do that?

best wishes from germany, Holger

IT-News und IT-Jobs auf w3Projekt.com

Cayhn’s picture

Could you explain a bit more, what do you mean with between tester-text and content? Where is that, maybe you can show a picture and mark it out or something :)

holger’s picture

I give you an example: in full-page view it should look like this:

=====
title

teaser-text teaser-text teaser-text teaser-text
teaser-text teaser-text teaser-text teaser-text

!! here i want to display a block (block id=1) !!

here is the rest of the content from this page
here is the rest of the content from this page
here is the rest of the content from this page
here is the rest of the content from this page

=====

best wishes from germany, Holger

IT-News und IT-Jobs auf w3Projekt.com

holger’s picture

here is an image of what i mean

http://w3projekt.com/demo.png

The Advertising is inside a block (id=1) and at the image you can see where i want to place it in my content.

I hope you can help me.

best wishes from germany, Holger

IT-News und IT-Jobs auf w3Projekt.com

holger’s picture

i found this one: http://drupal.org/node/53464

<?php
if ($teaser) { //if node is being displayed as a teaser
//Anything here will show up when the teaser of the post is viewed in your taxonomies or front page
} else { //all other cases
//Anything here will show up when viewing your post at any other time, e.g. previews
}
?>

But what changes have i to do for display a region as a block between teaser and content in full node view?
Hope you can help me

best wishes from germany, Holger

holger’s picture

I try to use this in my node-story.tpl.php

<?php if ($page) && if ($teaser) {
	  print $teaser;
print $block = module_invoke('block', 'block', 'view', 1);
print $block['content'];
print $content; }
?>

But than i get a white site overall :-(
But why?
Isn't it possible to display a region as a block between teaser and content in full node view?

best wishes from germany, Holger

IT-News und IT-Jobs auf w3Projekt.com