I was hoping that someone might catch something that I missed.
I created a new content type for OP called people_places based off of the article content type. I basically employed some of the same cck fields used the article type (author, main image, thumbnail, etc...), using the "existing" cck fields.
I then duplicated the node-article.tpl.php template file and renamed it, node-people_places.tpl.php. I flushed my cache. I even attempted to clear the theme registry (by going to the themes page and saving).
I want this new content type to mimic the article type, including how it displays images, etc...
When I view the actual people_places node content page, everything seems to appear like I expect it to, except the main image. I figured since I'm using the same cck field "field_main_image", it should display.
Does someone know why the main images is not showing up?
Thank you,
Joe
Comments
After a day of wrestling with
After a day of wrestling with this, I figured it out. I'm documenting this just in case someone else encounters this issue.
Because I'm not a developer, I was a little lost.
Everything I read says I just need to duplicate the node.tpl.php file and change the file name to node-[custom content type name here].tpl.php, clear the theme registry cache and everything should work. It didn't.
I assumed that since many of the relevant cck fields were the same (that I created the content type using existing cck fields), that it would then pretty much display the content correctly out-of-the-box (similar to how it currently displays articles nodes), without much tweaking. That obviously was not the case.
My custom node page showed the correct layout and with Theme Developer I saw that it was using the correct node-people_places.tpl.php, but it was missing some key components (author info, main image, etc...).
After some closer inspection, I noticed that the main image variable in the node-people_places.tpl.php file had a different name than the cck field ($main_image instead of field_main_image), then I noticed this statement in the initial commented portion of the file " * @see openpublish_node_article_preprocess()".
My initial search for * @see openpublish_node_article_preprocess() turned up nothing (I couldn't find it in the template.php file). Finally, after digging around I stumbled across node-article.tpl.inc files in the modules/openpublish_core/theme_helpers directory.
The node-article.tpl.inc appeared to define some of the variables, specifically $main_image, so I duplicated the file and renamed it node-people_places.tpl.inc. Cleared my theme registry cache again and viola... it worked!!! The author name, main image, etc... now display as expected on my new content type page.
As long as I keep track of this change to the Openpublish_core module, I should be fine, but when OP is upgraded again, I will have to make this change again.
Also, I created a sub-theme of the Openpublish theme in order to not have to customize base files. Is there something else that I can do so that the only customization I do is in my customized theme folder and not in other files that will get overwritten when OP is upgraded again?
Finally, I understand that the Open Publish distribution is a moving target. OP is constantly changing and improving and the developers are doing a great job in giving us a very solid platform to build our news sites.
The problem is, most of us are not accomplished Drupal developers, otherwise, we would probably build our sites ourselves. Instead, we have turned to OP as a way to quickly establish a robust news website. As non-developers, it is very difficult to find our way out of complex (or non-complex) issues.
It would be nice to have more extensive documentation for OP. The documentation that is currently available is fairly basic. What can we, the OP group members, do to remedy this issue in a formalized manner for the things that we are familiar with? Also, can the developers do more to document and explain the new features? Can something like a FAQ be created from some of posts addressed here?
I ran into this "issue" too
I ran into this "issue" too and found it hard to figure out why the preprocessing is done in a module that would be replaced on an upgrade, rather than in the theme folder. I guess they had their reasons, but there is a great deal of stuff in there that a themer will typically need to change (hard coding image sizes? really?!?)
Agreed about the documentation. OpenPublish is a fantastic distribution, obviously designed for people who want a complete publishing system out of the box, but the documentation could most charitably be described as "sketchy" and I've been finding it hard to figure out how to do things that would be simple for me in any normal Drupal site.