Strange template issue - existing page displays fine, new pages have no editable regions
Permalink
Hi There,
I'm trying to troubleshoot a weird template issue. To launch a site, I hid the news section and left the news template unfinished with one news item.
I've now completed the template and am ready to make the site live but whenever I create a new news item, no editable regions show up and neither does the sidebar.
When I view the rendered source, I'm seeing an error on a call to a custom attribute which is the news image.
The error is:
Line 34 is the call to grab the image which looks like this:
The only thing I added to the template was the date like this:
BTW, if I remove the image php, it works.
Not sure what I've done wrong as the existing news story renders fine and they both use the same page type/template.
Is it because there's no image for this news story maybe?
Any help would be much appreciated.
Cheers
Ben
I'm trying to troubleshoot a weird template issue. To launch a site, I hid the news section and left the news template unfinished with one news item.
I've now completed the template and am ready to make the site live but whenever I create a new news item, no editable regions show up and neither does the sidebar.
When I view the rendered source, I'm seeing an error on a call to a custom attribute which is the news image.
The error is:
<b>Fatal error</b>: Call to a member function getVersion() on a non-object in <b>/home/site-name/themes/theme-name/news_entry.php</b> on line <b>34</b>
Line 34 is the call to grab the image which looks like this:
<p class="left"><img src="<?php echo($c->getAttribute('main_image')->getVersion()->getRelativePath());?>" width="300" height="184"></p>
The only thing I added to the template was the date like this:
<p class="date"><?php echo $c->getCollectionDatePublic('D F j, Y') ?></p>
BTW, if I remove the image php, it works.
Not sure what I've done wrong as the existing news story renders fine and they both use the same page type/template.
Is it because there's no image for this news story maybe?
Any help would be much appreciated.
Cheers
Ben
Is that the right way to handle this?
The weird thing is that on the news home page now, the previous news item's thumbnail image appears in the page list (this news item doesn't have an image).
If I insert an image into the story it replaces it but when you delete the image, the second story gets the first story's image in the list - is there a default setting maybe?
Here is the call that grabs the custom image attribute in the custom pagelist template:
Man, you step away from a new CMS for a few weeks and BAM - you feel like a beginner!
Any know what I might be doing wrong?