By runeveryday on
i embed a Region in a node.tpl.php file ,it can work,but when i employ a block to it and set its background-color to red, and to my surprise is on the front page,there is also a red block there,yet it have't have some contents. only a rectangle red box, how to make it not show on the front page.any tips would be appreciated!
Comments
You did't specify what's the
You did't specify what's the name of your first page. Is it a particulary page that you created or it's Drupal's default page (node) ?
So your first page is node, then there you find the list of all node's teasers which were promoted to first page. To solve this, in the node.tpl.php create a html code that will be used just if $teaser variable is TRUE.
Otherwise, it what I've written above is not your problem, you could try using a particular template for the Drupal's front page. Go into your theme's directory an create a file called page-front.tpl.php. That template will be used when rendering your site's front page.
You can find usefull information concerning the Core template suggesions here: http://drupal.org/node/190815.
Let me know if that solved your problem.
Silviu
thanks for you answer,the
thanks for you answer,the first page of my site is Drupal's default page.i want to put a block at the bottom every post ,i have used a preprocess function to generate the variable i would used in node.tpl.php, a if $teaser variable is TRUE condition. the variable name i used is a theme's region pre-variabe,and i have deleted the output of the prevariabe in the page.tpl.php. but when i see the front page html code,there also have a div,which i have used in node.tpl.php after every post.
if i don't want to make a page-front.tpl.php,is there a way can solve my problem.
i have tried to create a
i have tried to create a page-front.tpl.php,whose contents is the same as page.tpl.php. the problem doesn't disappear.the rectangle box still bellow the teaser on my site home page.
now i used <?php
now i used
<?php if(!$teaser&&!$is_front) print...?>in the node.tpl.php,the box also there.why?Is it possible that!$is_front can't work?
On the Drupal's first page
On the Drupal's first page the list of nodes that Drupal displays is actualy the list of TEASERS. So in the node.tpl.php you have to use :
if($teaser){
DO SOMETHING
(here you place the HTML code for the node teaser)
}
else{
Do SOMETHING
}
If you have a test version of your site that I could see that it would be more simple to solve the problem.
i am very sorry,i don't have
i am very sorry,i don't have a test version site online, only to test on localhost. i used the theme is Deco(http://drupal.org/project/deco) now, i want to add a block under the node,to display other similar content,i used module Similar By Terms (http://drupal.org/project/similarterms),when i have done this, the node page does well,but the site's home page doesn't work well,there is a background-color under every teaser. can you help me to test it on your localhost.thank you very much.
and this theme also have another problem,when you enable css optimization,the style will not work under IE7.hope you can help me to test it.
I'm sorry - I cannot test for
I'm sorry - I cannot test for you. If I could give you an advice, it's my pleasure - but testing - I'm not a tester man.
ok! thanks all the same. i
ok! thanks all the same. i have removed the background-color.this looks better,but when you view the html code,you will find the html code of the content i added to node is still there.