Content function doesn't work correctly

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
webscientist
Posts: 25
Joined: Wed Feb 23, 2011 10:13 am
Location: Karlsruhe

Content function doesn't work correctly

Post by webscientist » Sat Mar 05, 2011 12:29 pm

On pages without names like mailform, search...the content fo the homepage is displayed on the bottom of the page.
The problem is that it's not checked correctly.

:idea:
Solution: Check for $f added to the content-function in file cms.php:

function content() {
global $s, $o, $c, $edit, $adm, $cf, $f;
if (!($edit && $adm) && $s > -1 && $f == '') return $o.preg_replace("/".$cf['scripting']['regexp']."/is", "", $c[$s]);
else return $o;
}

Then it's working correctly.

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: Content function doesn't work correctly

Post by Martin » Sat Mar 05, 2011 3:32 pm

Hi Thomas,
I am not quite sure, what 's your point. I guess you are talking about this "issue": If you name a page exactly like a function - "mailform" e.g., lowercase is important - you get a somewhat strange effect: CMSimple will display the mailform first, followed by your page's content.

Do you consider this as a bug? First of all, probably noone will name a page "mailform" (maybe "Mailform"). If someone really does, he must have something in his mind. You are right, probably he just wants to call the mailform()- and that is what happens with your fix. But we do not know if he wants to add some additional text or has something completely different in his mind. We should leave it to him.

Edit:Yesterday I posted some stupid code, that only works for the vistor - and turns off the WYSIWYG editor in edit mode. I deleted it now.

I guess we just have to accept some reserved words: We can't give a <h1>-page a lowercased name that is also used for an internal cmsimple function. IMHO that 's totally ok and no big limitation.

KR

Martin

Post Reply