0

I was wondering how one would go about changing the layout of the nodes when you are adding content, as well as when you view the full story.

I want certain text to be bigger, some fields to be placed side by side, some vertically. I want full control over the layout. I tried editing the CSS to change fonts and colors but it all changes fonts for the enitre website and not just in the node view. any thoughts?

1

page--node--[content-type].tpl.php = node template for a specific content type (no square brackets)

page--node--add--[content-type].tpl.php = node/add template for specific content type.

Copy/paste the code you have in node.tpl.php and clear your server cache. Now you can add custom classes everywhere or even create a custom HTML structure to render your fields. See the node.tpl.php documentation and Drupal 7 template suggestions.

Hope this helps!

  • It's strange. The docs say that the template for a node type should be node--[content-type].tpl.php and this works for me. However, node--add--[content-type].tpl.php doesn't work for me, and prefixing it with page-- does make it work (sort of, anyway -- drupal recognizes it as the template for the add content page for that type, but fails to display the page). Any idea about why it's inconsistent that way? UPDATE: never mind, it's because you can set a template for any page at all starting from the page-- root. Anyway, thanks! – octern Apr 2 '12 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.