I am trying to create a theme using box_cleanslate as a starting point.
In a page that lists multiple nodes (example: /node), every node is output in its own <div class="node"> which contains the title and content. This enables me to display each node in a box.
But when I click to view a node by itself (example: /node/9), there is no <div class="node"> anymore and the headline is output above the edit tabs.
No matter what I try, I can't get the title to output below the edit tabs.
My goal is -- on the individual node page -- to have the title to appear inside my box along with the body of the node, and below the edit tabs, so that the individual node view is consistent with the multiple node view.
Can someone help me clear this up?
Comments
Yes, by editing the templates.
You need to modify page.tpl.php to move this bit:
After this bit:
You'll probably want to tweak the styles a bit in styles.css to get the spacing to look better.
That worked, but...
I did as you instructed and the title(h2) is now output below the tabs: (sweet)
However, the headline is still above(outside of) the <div class="node"> which makes the title appear outside of the main box.
See, on my main page I have a black background with a series of white boxes(each containing a complete node) and my text is black. So the issue is that when I view an individual node, I have a black title on top of a black background, above the white box instead of inside it.
How can I get the title to output inside the .node div, like on the main page?
: z
Ok I got it perfect now.
Ok, thanks to Chris pointing me in the right direction, I figured it out and got exactly what I wanted.
In node.tpl.php I moved the <h2>... outside of the if statement.
From this:
To this:
But that caused the title to appear twice on the individual node page(once above the box and once inside the box), plus the title inside the box was still being rendered as a link even though it was a link to the page I was already on.
So I first removed the extra title (the one outside the box)from page.tpl.php.
In page.tpl.php remove this bit altogether:
and finally, in order to make the title so that it is only a link if the node is on another page(as opposed to the individual node view) I added an else statement to the node.tpl.php.
In node.tpl.php, changed this:
to this:
Now the node has the same structure on the individual page as it does on the main page (or taxonomy listing etc.)
: z
Thanks!
Thanks, this really helped me out!
Now using this on my site - might even try and adapt it at some point.
[euchrid]
www.euchrid.co.uk