CMS Made Simple Forums
https://forum.cmsmadesimple.org/

[SOLVED] AdvancedContent fields content get deleted when editing page
https://forum.cmsmadesimple.org/viewtopic.php?f=41&t=47555
Page 1 of 1

Author:  Milhaus [ Wed Sep 22, 2010 11:31 am ]
Post subject:  [SOLVED] AdvancedContent fields content get deleted when editing page

When i try to use AdvancedContent created blocks in templates, created in MLE, content was saved in them, but it got deleted, when I edited the page again.

Is there some possibility to fix this?

Author:  Milhaus [ Fri Sep 24, 2010 7:06 pm ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

Bump. Do you need more info? Perhaps I should have add, that I am using the latest versions of both modules.

Author:  NaN [ Sat Sep 25, 2010 10:10 pm ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

Do you use whitespaces or special chars (UTF8 chars) in the blocknames?

Is the content really deleted?
Please take a look in the database (table content_props, order by id) and make sure the content of all the content properties is there.

Author:  Milhaus [ Sun Sep 26, 2010 11:19 am ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

Thanks for your suggestions! I finally got it working.

First, I didn't observed any difference between using block names with whitespaces and without them. I didn't used any non-ASCII characters.

And second, the content wasn't deleted, indeed. But I wasn't aware, that when I am saving that block a new block is created in the background, named block_name_cs (or code of whatever language defined in MLE) and content in saved in that one. So when I modified the code in template accordingly, it strated to work.

So, please ,add something like this in the help page of the next version:

CMSMadeSimple Multilingual (MLE)
If you are using CMSMadeSimple Multilingual (MLE), keep in mind, that you need to add language suffix (look for calue of DB block in MLE administration interface) to the block parameter, like this:
\$1:
{content block="your_block_name_en"}
or
\$1:
{content block="your_block_name_fr"}


Otherwise, the interface for editing pages won't work properly (saved values won't be displayed).

Author:  NaN [ Sun Sep 26, 2010 12:39 pm ]
Post subject:  Re: [SOLVED] AdvancedContent fields content get deleted when editing page

Well, this should not be needed.
I thought i fixed this already.
It doesn't make much sense if the user needs to apply the language by himself.
This would make MLE useless.
The purpose of MLE is to show content in the selected language no matter what language it is. So the user does not need to specify a certain language in template.

I will do some investigation why AdvancedContent does not load the right language block.

Author:  Milhaus [ Sun Sep 26, 2010 2:43 pm ]
Post subject:  Re: [SOLVED] AdvancedContent fields content get deleted when editing page

I think it might make sense, if there will be need for different fields in different languages. For example, I can imagine a website with one main language variant with many fields and several other, with one one, say, Summary. Perhaps there should be possibility to adjust this behaviour in the settings of AdvancedContent.

Author:  Milhaus [ Sun Sep 26, 2010 3:45 pm ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

OK, this isn't solved at all, because _cs (or _en) is added each time, when saving. So it's completely unusable. Sorry for false report.

Author:  NaN [ Sun Sep 26, 2010 4:56 pm ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

I noticed a typo error in AdvancedContent/inc/function.displayContentBlocks.php in line 67.
There i says

\$1:

if($this->mle && !$this->blockLang != '' && $blockInfo['block_id'] != 'content' . $this->blockLang)



but it should be

\$1:

if($this->mle && $this->blockLang != '' && $blockInfo['block_id'] != 'content' . $this->blockLang)



(without the ! bfore $this->blockLang != '')

But i'm not sure if this caused the error.

Author:  Milhaus [ Sun Sep 26, 2010 7:50 pm ]
Post subject:  Re: AdvancedContent fields content get deleted when editing page

Thanks a lot! It seems to be working. But I will test it further and will let you know, if anything breaks.

EDIT: Well, I think I can say it more confidently now. So I am marking it as SOLVED for a second time.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/