sectionimage tag error on preview

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
klaus
New Member
New Member
Posts: 6
Joined: Tue Oct 31, 2006 12:01 pm

sectionimage tag error on preview

Post 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
Jay7

Re: sectionimage tag error on preview

Post by Jay7 »

I have this problem also but

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

is on line 14 for me. Hope there is a fix.
Last edited by Jay7 on Fri Nov 17, 2006 5:55 pm, edited 1 time in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm
Location: Helsinki, Finland

Re: sectionimage tag error on preview

Post 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
drharris

Re: sectionimage tag error on preview

Post 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.
Post Reply

Return to “CMSMS Core”