OK folks, sorry to bother you but I really feel like I'm going mad here.
I have created a content type called 'dualcolumn' as I want to split my content into columns. The fields work nicely in their form but I don't seem to be able to influence them using node-dualcolumn.tpl.php (a copy of the node.tpl.php file that I have renamed and placed in my subtheme folder). I want to be able to use the template to print out $column1 and $column2 (amongst other things) so that I can theme them. When I put:
<pre>
<?php print_r($node) ?>
</pre>into my node-dualcolumn.tpl.php I don't get any result. I've read through the help in CCK but can't work out what I'm doing wrong.
Does anyone know where I'm going wrong?
Any help would be very, very gratefully received.
Many thanks
Durruti
I'm using the latest drupal 6, CCK and Zen theme (as a base). I have fckeditor enabled but have excluded these fields.
Comments
Sorry for obvious question
Have you used theme developer module to verify that you're using a recommended names for blocks/nodes/pages etc?
Not obvious at all to me, thanks for that!
I'm just installing it now. I think jastraat has solved the initial problem for me it now works, with the original node.tpl.php in my subtheme. But I'm sure this module will help me further. I had trouble finding it, so for any other new folk looking for it, it is part of the "Devel" module.
Thanks,
Durruti
One thing to watch
I love the Devel module but it is a bit of a pest -- causing various other problems, such as style rendering problems, which is why you don't always leave the theme developer tab running.
clear your theme cache by
clear your theme cache by visiting the theme administration page.
If none of the above
If none of the above comments work, I believe that you will need to have a copy of the basic node.tpl.php file in the subtheme as well in order to overwrite it by content type at the same level. Odd I know - but that's how I fixed a similar problem.
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
That was it!!!!
Brilliant Jastraat, that fixed it, how crazy I spent hours trying to work that out and I think you just saved me many more! Perhaps I will sleep tonight after all... Hope this helps any others that might stumble apon this, is it documented anywhere, I didn't read that as part of the tutorials I've read.
Thanks again, mate!
Durruti
FWIW
Its documented here in the Drupal 6 theme guide - http://drupal.org/node/190815
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Glad t' help. I spent a
Glad t' help. I spent a good day figuring that out myself.... :)
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
I would advise using CSS to
I would advise using CSS to handle placement of items on a page - have it so it is reasonable defaults incase something weird happens and the CSS doesn't load correctly from Drupal (more likely though, the person's browser doesn't load it correctly), but have each thing you want to position have an id in the .tpl.php file, then add to the .css file the positioning of it.
Some sample CSS that may help you get started (whats after the ; are annotations to explain it - I'm not sure how to appropriately annotate CSS, so that may not work well)
That is my plan, but not sure how...
Thanks Ninja overlord,
That was my plan, but my problem is that it is not various different nodes that I am dealing with but blocks of text that I want to divide and break up (newspaper style), it also needs to be editable by users and members need to be able to add dual column pages.
There seems to be a lot of forum activity around this subject, but not much for drupal 6, maybe the improved views grid stuff has fixed it for a lot of people.
If you have any ideas of easier or more sensible ways than what I am attempting I would be very grateful. I'd like to write it up when I eventually have it all down, as there seems to be some demand for something similar.
Ideas very gratefully received.
Cheers
Durruti
...
jQuery option - http://welcome.totheinter.net/2008/07/22/multi-column-layout-with-css-an...
CSS3 option - http://www.w3.org/TR/css3-multicol/
Food for thought - http://www.456bereastreet.com/archive/200509/css3_multicolumn_layout_con...
IMO - good for spiltting lists, short blocks of text (aka Apple style), bad for spliting long blocks of text, i.e a long news story. Great for print, sux badly on the web. IHT used to do it, now they dont (because it sucked).
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thanks for that...
Cheers Jmburnz
II'd found these on my travels, but must have IE compatibility so CSS3 a no go for the foreseeable future (and meet web accessability guidelines, so no '-moz' tags), though I did use it in a demo as they all use macs. I've always but a bit afraid of Jquery stuff but maybe I need to get over that. What I need is basically just static column stuff to meet clients design requirements, they are quite short pages with static width, so while it requires a bit of intelligence in input from users, they are happy with it. I agree that newspaper style can be a nightmare, but I also think something to split the main content section in two is useful (esp on sites with no or only one sidebar). It just breaks it up a bit.
Thanks for the input, it's good to have all the options collected together in one place.
Durruti