By holydrupal on
I wonder how could I remove specific page titles?
What I want is that when the page X is assigned to taxonomy named "invisible" the title of the page won't be display.
I think in the page.tpl before the code:
<?php if ($title): print '<h2' . ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
we must use an IF and assign the taxonomy but because I am not familiar with programing I couldn't do this, could someone help me?
any idea or better solution?
Comments
another way to do this would
another way to do this would be to assign a different page template to your pages where you don't want the h2 to display and adjust it from there. if there is a certain logic to when and where the page title is displayed, i would probably choose this option.
however, your idea with the taxonomy sounds ok to me, too. then the user decides whether or not to show the page title. i'm no php-er, but i did use the following in a node template to display different content depending on taxonomy:
me telling you what to do with php is a case of the blind leading the naked, though. if i were you i'd wait a bit to see what others have to say...
Thanks for your solution, I
Thanks for your solution,
I think the theme trick would be easier for me; could you give me more information on how to create a tpl in drupal and how to assign it with my specific pages?
I know I must copy the page.tpl.php but don't know how to assign it to the invisible taxonomy or how do I should redirect the pages to the new template?!
I saw your second comment too, but it is helpful just for a few specific pages not for 30 or 40 pages. I couldn't name each new page (invisible assigned page) in the php code.
Best regards,
Sotoodeh
this page will help you
this page will help you develop your theme depending on page templates:
http://drupal.org/node/104316
plus, i just saw on this page^^ that you can do it based on taxonomy terms this way as well, which is something i haven't tried (just a newbie, too :)).
also, i would recommend downloading and reading the first chapter of the drupal book:
http://www.apress.com/book/supplementDownload.html?bID=10258&sID=4237
it covers theming very well and was of great help to me. good luck!
Thank you so much for
Thank you so much for noticing the book. I was not aware of this new book. sure i will read it.
I visit the link and I will the taxonomy theme and also the theme function.
thank you very much for help
very appreciated :)
Best regards,
Sotoodeh
i came across a post
i came across a post asking a similar question. perhaps this helps:
http://drupal.org/node/151338
oops
tripple post
.
.
I am a Drupal 7 user and I do
I am a Drupal 7 user and I do not want the page title to show on specific pages. I know I can hide a page title using a statement like this on page.tpl.php:
What if (this is my case!) I don’t want multiple pages not showing the page title?
This is what I am doing:
I know it should be possible to use a OR statement such as:
However, this does not work… (OTHERPAGE still shows up)
I know I am probably doing something very stupid… I am just too tired, too lazy or I am just a lousy PHP programmer… I just can’t figure this out!
It would be nice, however, when creating a post just to tell if the title should be visible or not… On a “per-post” basis… This is probably the reason why I should think about writing a Drupal module that would do this… After all, the source is with me, Luke!
A good module approach
http://drupal.org/project/content_type_extras - Allows you to disable the title for a given content type and then override this option for a specific content. Good enough for me!