Page 1 of 1

sectionimage tag error on preview

Posted: Thu Nov 16, 2006 4:24 pm
by klaus
hi!

i get following error message:

Fatal error: Undefined class name 'contentmanager' in .../plugins/function.sectionimage.php on line 44

line 44 and 45 are:

  // which page are we viewing?
        $curPageID = $gCms->variables['content_id'];
        $curPage = ContentManager::LoadContentFromId($curPageID);

but only with site preview.
otherwise everthing works fine (e.g. save and then view site)!

i use CMSMS 1.0.2 "Maui"
with pretty urls
and sectionimage 0.5

hope someone can help me.

Greetings
klaus

Re: sectionimage tag error on preview

Posted: Fri Nov 17, 2006 5:54 pm
by Jay7
I have this problem also but

$curPage = ContentManager::LoadContentFromId($curPageID);

is on line 14 for me. Hope there is a fix.

Re: sectionimage tag error on preview

Posted: Thu Nov 23, 2006 6:21 pm
by KO
I get the same error with 1.02 and section image. Works nice othervice but page preview stops when it finds section image tag and gives error

Fatal error: Class 'ContentManager' not found in /plugins/function.sectionimage.php on line 44

So if someone has a solution would be nice to know.

K

Re: sectionimage tag error on preview

Posted: Wed May 02, 2007 8:43 pm
by drharris
I've been battling this all day now. I personally don't use preview mode, but some of our employees do. I'm posting the solution in case other people get here through google as well...

I solved it this way, but I'm sure there's a better way to do it. This seems to ignore sectionimage if it's in preview mode:

Code: Select all

{if $SCRIPT_NAME != "/preview.php"}
       {sectionimage image_path="/path/"}
{/if}
You have to wrap every {sectionimage} call in that conditional block.