If you have a look at http://ethixmerch.com/supplier/union-specialties, you'll see a node, which is a cck node type called "supplier" with the following elements displayed:
- some body text
- then a link called "Visit Supplier site...". This link is generated by a cck field.
- a colorful listing of the categories assigned to the node. Next to each category is some icons.
- last, there is a picture generated by imagecache
Also on the page are two other elements that are the focus of this post:
A preprocess function themes the node to display this category listing. This is located in the template.php file. Along with this preprocess function is a function to ensure this process gets called.
See http://pastebin.com/m31c17caa to see these two functions, along with the node-supplier.tpl.php template file to display the node.
The problem
===========
When this node is previewed, items #3 and #4 aren't visible, all that you see is the title of the node and the body. There is no image and no pretty view of the taxonomy.
Is there a way to make the image and view of the taxonomy display when previewing the node?
Comments
Contemplate
I think that the Contemplate module is probably what you need. It can define how the node view, preview and RSS items will be displayed.
http://drupal.org/project/contemplate
-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com
My 2cents
I found this information quite helpful: http://drupal.org/node/53464
The tpl files in the basic theme are awesome! http://drupal.org/project/basic
Contemplate is very cool too (agree with above comment)
Devel module can help you view variables for printing. http://drupal.org/project/devel
GL!
Certainly a thorny one
Certainly a thorny one eh?
For the imagecache image not printing in preview you may want to look into the imagecache issue queue for the version you are using, since it looks like you are printing that through the default $content variable it should be printing. Maybe there is some issue there with filefield (are you using filefield + imagefield + imagecache?) afaik this is all still in development so there maybe some issues there.
As for the preprocess function, well looks like something is messing up during the preview - I think this may have something to do with using taxonomy_get_vocabularies in the node template - I say this because I've noticed in a few of my sites when I modify the output of terms using similar fucntions the terms dont show up in preview either. Sorry, I dont know the intricies of those functions to give a definitive answer.
BTW I was not even aware you could do a themeName_preprocess_hook__nodetype preprocessor function (bit of any eye opener for me, nice...). I would think the preprocess functions and node.tpl are being called by theme() during the node_preview output, so that drives me to think its further down the line, hence pointing the finger at taxonomy_get_vocabularies.
Just my two cents, we need a bigger brain on the job;)
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.