Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
i have a node-content-type.tpl page enabled but It seems the page title is only part of the page.tpl file and not the node.tpl. So I cannot change the page title's style for a specific content type only for the overall pages of the site. Is there a way around this as I want to theme nodes of specific content types.
The body section is fine and I can target the css to change this it is the page title that is the problem.
Thanks in advance
Jimmel
Comments
Comment #1
kari.kaariainen CreditAttribution: kari.kaariainen commentedDoes the theme you are using provide node type related classes in the body element? For instance Zen theme does. If yes, then you can target the title with .node-type-mynodetype h1.title.
Comment #2
Jimmel CreditAttribution: Jimmel commentedThanks for the reply.
No .node-type-mynodetype h1.title does not work.
I can target the title with .PostHeaderIcon-wrapper but it targets the whole site. The node content type is called product from the node-products.tpl.php page. Here is the code for that node file
the .productHeaderIcon-wrapper
class is in there but that does not seem to target the title on the page.
Is there a way to override the sites title for specific content types using something like
.product-body .productHeaderIcon-wrapper
I cant seem to see the right combination and it could be something simple.
Cheers
Comment #3
kari.kaariainen CreditAttribution: kari.kaariainen commentedYou should be able to print the $type variable to some suitable spot, for example in the first div, same way the $sticky and $status are printed in this theme, just mind the spaces. Then you could target the title, which seems to be h2, not h1, with .mytype h2.