Page 1 of 1

[Solved] Comments Module - prevent replacement of content-block

Posted: Thu Nov 08, 2007 12:33 am
by nhaack
Hi there,

it is a long road to build a dream-site for someone not that experienced with programming. However, I learn a lot. Which on the one hand doesn't let me progress as fast as I'd like. On the other hand, since I work on my CMSMS-site I learned more about practical web-desgn than probably ever before!

However, I came across another problem I can not solve on my own. It's a, hopefully small, problem with the comments module. It works great until someone makes an mistake. In that case, it looks like the page is reloaded and the usual content-block {content} in my template is replaced with the content of the comments template. However, the comments area is also displayed in it's intended place in the template (both comments areas show different captcha codes).

The html source I looked at, supports my guess. Exactly where the content of the content-tag should be nested, I find the output of the comments template with the error codes. The comments form below (where actually intended) does not show the error messages.

I disabled all options, took the default template, but still, when an input error occures, the content block is replaced. I realised, that the index.php is called directly and not the articles url when an error occurs (also happens when url-rewrite is off).

I wonder if anyone had the same problem and if so, what settings did you make? Has anyone an idea of what this could be?

I run on the latest official cmsms release.

best regards
nils

Re: Comments Module - prevent replacement of content-block

Posted: Thu Nov 08, 2007 8:00 am
by cyberman
Can you post a link?

Re: Comments Module - prevent replacement of content-block

Posted: Fri Nov 09, 2007 10:41 pm
by nhaack
Hi cyberman,

I made a fresh install to make sure it is not my template. You can check it here: http://www.nilshaack.de/qs/index.php.
If you just supply one of the fields with content, you should see what's happening.

In this example, I just added the simple comments tag {cms_module module='comments'} to the template "Left simple navigation + 1 column" (right behind: {* End Content *}).

I think, I don't understand how to use the module (and this is a feature) and there might be a flag to disable the option? Probably  the location of the tag is wrong in the template?

I took the most current version of CMSMS (1.2 Barbados) and Comments (1.8.2). Feel free to post as many test-comments as you like :).


Greetings
Nils

[Solved] Comments Module - prevent replacement of content-block

Posted: Sat Nov 10, 2007 12:19 am
by nhaack
Well, I made a second fresh install I could play around with.

My problem is, that the content tag gets replaced with the content of the comments form. Basically a nice feature. On the fresh install I could see how this function works well. Focus on the essential. But since my actual page content consists of several content-blocks and uses a rather graphical layout, the layout gets distorted (as only {content} got replaced).

So, I came up with a solution that seems to work for me, I couldn't experience any problems as of now. I will have to make some small modifications to two own tags, but that's just changing names. I replaced the tag {content} with {content block="new_content"}.

So as I don't have a {content}-tag in my template any longer, it can not be replaced :). I do now have an empty content block in my editors view, as the default block seems to be featured always. But I can surely live with that :).

This is not quite a solution, but a workaround that might be helpfull for others. The solution can be seen at the samle URL as posted above.

None the less, I would be interested to know, if this feature can be dissabled.

Thanks & greetings
Nils

Re: [Solved] Comments Module - prevent replacement of content-block

Posted: Mon Jan 28, 2008 2:17 am
by jcaudill
Believe it or not - this answer is so easy it's very baffling why they didn't do this in the first place.

You have to edit line 263 of action.default.php. Change:

Code: Select all

$start_form= $this->CreateFormStart($id, 'default', $returnid, 'post', '', false, '', array('redirecturl' => $redirecturl,'pageid' => $pageid...
to

Code: Select all

$start_form= $this->CreateFormStart($id, 'default', $returnid, 'post', '', true, '', array('redirecturl' => $redirecturl,'pageid' => $pageid...
(please note this isn't the entire line, just the first part).

It's the "false" paramater that needs to be true. This signals the CreateFormStart method to do an inline replacement instead of replacing the content.

HTH,
JP