By jdln on
I want to remove the H1 title of pages that's in the div content-header. However I only want to do this for content ive created. I want logged in users to still see the title of pages in the admin menu.
By removing some php from page.tpl.php I can hide the title, but the title of pages from the admin menu disappear aswell.
Thanks
Comments
_
Did you try simply removing
<?php print $title ?>(or something like that depending upon your theme) from node.tpl.php?I tried removing that code
I tried removing that code from node.tpl.php on my override template but nothing happened.
I then removed all the content from that page as a test and again nothing happened.
I thought this was an override issue and to check i removed all the content from node.tpl.php in the zen folder (the template im using) and nothing happens when i cleat the cache and refresh the page. This seems strange as if i remove the content from template.php in the same zen folder, this does have an effect on the page.
Id really appreciate any feedback on this but should i be posting in the zen template forum?
Thanks
_
hmmm... are you using your own subtheme of zen? If so, you'll need to copy the base node.tpl.php file to the directory of your subtheme, then any additional node-*.tpl.php files should be detected properly. Then, if you remove all the content from node-type.tpl.php you should get a completely blank content area for nodes of that content type.
Ive just realized something.
Ive just realized something. The code you suggested commenting out is in h2 tags;
But the title im trying to remove is in h1 tags. Presumably that means node.tpl.php is the wrong file and this isnt a zen template issue.
The h1 tag im trying to remove is in this code on the page;
_
If it's in h1 tags, then you probably need to edit the page-tpl.php file instead. And again, you'll need to copy the base page.tpl.php file to your subtheme directory before any derivative suggestions are detected.
Ive set up the override for
Ive set up the override for my page.tpl.php. The problem is that if i remove this;
<?php print $title; ?>From here;
Then the content-header title is removed from my Admin pages aswell as my content pages. What I need is for it to be removed from my content page only.
Sorry if i sent you on the wrong course their by talking about my template.
Thanks
_
Try changing
<?php if ($title): ?>to<?php if ($title && arg(0) != 'node'): ?>-- let me know if that works.Its worked for pages ive
Its worked for pages ive created by not for the blog and contact page.
Its removed the title of Create Content links but not of My Account or Administer.
_
You'll have to play around with the condition to get exactly what you want. For example, to add blogs, try:
The http://api.drupal.org/api/function/arg function merely grabs the various pieces of the URL so you should be able to get at most of what you need with it.
OK. This is beyond me at the
OK. This is beyond me at the moment, im new to Drupal. Maybe ill use a css solution in the short term.
Thanks for all your help.
_
One last suggestion, try:
I get a blank page. Thanks
I get a blank page. Thanks anyway though.
_
My bad there was a syntax error. Should be:
Again Im getting a blank
Again Im getting a blank page. Just to be specific, im replacing the contents of the h1 tags with code you suggested.
to
_
nope-- sorry I should have been more specific.
Replace:
With:
It works! Thanks so much.
It works! Thanks so much. Looking at the php i think i understand what youve done but i couldn't have written it myself.
_
excellent-- happy we got it sorted.
Thanks
Wanted to say appreciate the code fix. Not understanding the correct syntax for php I was lost. I used this to remove the page titles as well as the contact form title as well. Cheers.
if ($title && arg(0) != 'node' && arg(0) != 'contact'):