[SOLVED] CustomContent tags seem to be rejected

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
Art-art

[SOLVED] CustomContent tags seem to be rejected

Post by Art-art »

Hi,

After upgrading from 1.2.5 to 1.3 I faced some problems that are solved now. Great!
Now there seems to be one strange thing left: The CustomContent tags seem to be rejected. I tried clearing the cache, re-installing CustomContent. Up till now no solution.
The template of the page runs well. However at the point of the tag in the content something goes wrong.
First there is a Template that looks like this:

Code: Select all

.....
      <!-- Start Content Area -->
      <div id="main">
         <div style="float: right;">{print showbutton=true script=true}</div>
         <h2>{title}</h2>
         {content}<br />

         <!-- Start relational links -->
.....
The page using this template contains a lot of information. The first (and I thinks most relevant) lines are:

Code: Select all

{cms_module module=CustomContent} {if $ccuser->loggedin() && $ccuser->memberof('forum_members')}
<h3>blah blah blah</h3>
.....
This is to show information only to forum members.

The output now says:

Code: Select all

.....
<img src='modules/Printing/printbutton.gif' alt='Print this page' />
</a>
</div>
         <h2>Title</h2>
         string(131) "Smarty error: [in content:content_en line 1]: syntax error: unidentified token ';loggedin()' (Smarty_Compiler.class.php, line 1407)"
string(126) "Smarty error: [in content:content_en line 1]: syntax error: unidentified token ';&' (Smarty_Compiler.class.php, line 1407)"
string(146) "Smarty error: [in content:content_en line 1]: syntax error: unidentified token ';memberof('forum_members')' (Smarty_Compiler.class.php, line 1407)"
The code I'm using is an exact copy of a second site running the same content.
Related module versions are
- On running site:
     CMSMailer: 1.73.12
     CustomContent: 1.5
     FrontEndUsers: 1.4.2
- On site with errors:
     CMSMailer: 1.73.13
     CustomContent: 1.5
     FrontEndUsers: 1.4.3

Any idea of where to look for the solution?
Last edited by Art-art on Mon Jun 23, 2008 11:32 am, edited 1 time in total.
cyberman

Re: CustomContent tags seem to be rejected

Post by cyberman »

If you insert Smarty tags with a WYSIWYG Editor you should check page source.

This

Code: Select all

{cms_module module=CustomContent} {if $ccuser->loggedin() && $ccuser->memberof('forum_members')}
<h3>blah blah blah</h3>
.....
must be

Code: Select all

{cms_module module=CustomContent} {if $ccuser->loggedin() && $ccuser->memberof('forum_members')}
<h3>blah blah blah</h3>
.....
Some Editors modifies sources so it makes trouble  :-\ ...
Art-art

Re: CustomContent tags seem to be rejected

Post by Art-art »

Hi Cyberman,

You must be right. So I tried...

Initial response:
The thing is now that TinyMCE as included in CMSMS does this. When I mark 'Turn WYSIWYG on/off' below to switch it off, I can correct the line. After submitting the code it still goes wrong and the && is there again....
I know I can change the code through phpmyadmin. There must be better ways, I guess  :)

My response after 2 hours of playing around:
The case is solved. Not only & for & but also -> for > was causing trouble. Further returns after each tag are needed.
Only when I write the code exactly like this

Code: Select all

{cms_module module=CustomContent}
{if $ccuser->loggedin() && $ccuser->memberof('forum_members')}
it goes well.

Strange enough the code is shown wrong when I open the editor again. Changing anything (also when not in the content field) and pressing 'Submit' results in wrong code again. Every time I want to maintain something in a page I have to correct this part of the code.
If there is anyone who knows how to solve this it would be welcome.

Kind regards,

Arthur
Last edited by Art-art on Mon Jun 23, 2008 11:28 am, edited 1 time in total.
cyberman

Re: CustomContent tags seem to be rejected

Post by cyberman »

Move the Smarty logic to the page template, so you will have no trouble with TinyMCE. It should looks like

Code: Select all

{cms_module module=CustomContent} 
{if $ccuser->loggedin() && $ccuser->memberof('forum_members')}
{content block='loggedin'}
{else}
{content}
{/if}
This
blah blah blah
.....
could be inserted now in content blocks.
Art-art

Re: CustomContent tags seem to be rejected

Post by Art-art »

I'll do that, That's some work since I'm using one template for a few pages with and without the CustomContact logic.

Thanks,

Arthur
cyberman

Re: [SOLVED (partial)] CustomContent tags seem to be rejected

Post by cyberman »

No, you have nothing to change!

If users are not logged in they will only see the regular content block. If they are logged in they will see only content block named loggedin.

As you see you can use one template furthermore ;).
Locked

Return to “[locked] Installation, Setup and Upgrade”