Closed (fixed)
Project:
Fusion
Version:
7.x-2.0-beta1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2012 at 11:55 UTC
Updated:
5 Apr 2012 at 22:50 UTC
hi,
using this lovely theme, i have the node-type class in the body element and in the div.node element, but nowhere in between.
i'm trying to add the node type to the div#content-region inside page.tpl so i could control things like the title and the block-system-main, without it being page wide (and thus interfering with overlays i might add).
the only reference i found in the code was this -
$page['content']['system_main']['nodes'][node-number]['#bundle']
but it seems a bit complicated. any ideas?
Comments
Comment #1
sheena_d commentedYou can use the body class as part of your CSS selector in order to make your CSS for other body elements more specific. For example, i you wanted to style the page title only for blog node types, you would use this CSS selector:
or if you wanted to style paragraphs inside #block-system-main only for blog node types, you would use:
And so forth. You can learn a bit more about CSS specificity here: http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you...
Cheers,
Sheena
Comment #2
IdanC commentedsheena, again you amaze me with you're quick and thorough respond, thank you!
but with your example, if another h1.title would appear in that page (for example inside a colorbox window) it will have the same styling, even though it is not a blog title.
therefore, i'm looking for a way to add the node-type class to something less general than the body tag, for example div#content-region.
Comment #3
sheena_d commentedYou could narrow the CSS selector by whatever region the element you want to affect is in.
For example, you could use this selector:
This would serve the same purpose as if the "node-type-blog" class were added to the #content-region div. You can make the selectors as specific or general as you need, without needing to implement heavy programatic solutions within your theme.
Comment #4
IdanC commentedas always, you are right, but in my case it's a bit more complicated -
to be specific, when i load an overlay, i don't load the body element of the page i'm loading, but only the main or the content div. and in those cases, I can't refer to the h1 element in the overlay.
did i explained my self better?
Comment #5
sheena_d commentedCan you perhaps provide a link to the site where this is occuring and let me know how I can get the overlay to display?
Usually, these overlays will not use the theme's page.tpl.php, but have their own, so changing your theme's page template may have no affect on the overlay and it is difficult for me to predict what CSS would work best for you without seeing a specific example.
Thanks!
Comment #6
IdanC commentedusually these overlays will have their own .tpl, but i thought using the jquery load function with a reference to the #content-group element would be simpler.
and for the link, please visit hallo.co.il and click the bottom banner.
Comment #7
sheena_d commentedSorry this issue fell off my radar. There are a number of ways you could structure the page template for these overlays so that you have a node type-based CSS class to target your styling with. This will most likely involve writing a custom implementation of temlate_preoprocess_page() to creates a custom variable that can be printed out as the class on one of the page content's wrapping divs. If you are new to preprocess functions in Drupal themes, I would recommend reading the documentation on Overriding Themable Output.
Cheers,
Sheena