Please help with smarty tag usage [SOLVED]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
christophera
Forum Members
Forum Members
Posts: 94
Joined: Sat Jun 06, 2009 10:43 pm

Please help with smarty tag usage [SOLVED]

Post by christophera »

I'm slowly learning my way around cmsms :)

Smarty tags is what I am working on now...  where can I use them?

Right now, I want to make a link on a page available just to logged on members.

I went to content/pages/thepage, and in the content wysiwyg editor, I put:

{if $customcontent_loggedin > 0}Download and print the lesson plan here. {else}Students: please log in to print lesson plan.
{/if}

But it breaks the page:  string(121) "Smarty error: [in content:content_en line 5]: syntax error: unidentified token ';' (Smarty_Compiler.class.php, line 1407)"

Do smarty tags not work directly in the content section like that? Do they only work in templates, that's where I used them before, but I thought it would go here on the single page level, no?

Thanks for any help,  Chris

(1.5.4, with feu and customContent installed)
Last edited by christophera on Fri Jul 31, 2009 8:43 pm, edited 1 time in total.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Please help with smarty tag usage

Post by JohnnyB »

I think you can use this instead:

{ if $ccuser->loggedin() }Download and print the lesson plan here. {else}Students: please log in to print lesson plan.{/if}


smarty tags are ok in the editor but I usually toggle it Off to work with them.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
christophera
Forum Members
Forum Members
Posts: 94
Joined: Sat Jun 06, 2009 10:43 pm

Re: Please help with smarty tag usage

Post by christophera »

Tried that and get:

string(131) "Smarty error: [in content:content_en line 5]: syntax error: unidentified token ';loggedin()' (Smarty_Compiler.class.php, line 1407)"

So if it should be ok to use it in the content like I did, I'm guessing something is wrong in smarty or my set up?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Please help with smarty tag usage

Post by jmcgin51 »

your WYSIWYG editor is mangling your Smarty tag by converting the ">" to the equivalent HTML code.

from

Code: Select all

{if $ccuser->loggedin() }Download and print the lesson plan here. {else}Students: please log in to print lesson plan.{/if}
to

Code: Select all

{if $ccuser->loggedin()}Download and print the lesson plan here. {else}Students: please log in to print lesson plan.{/if}
Turn off your WYSIWYG, or better yet, put this code in your template.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Please help with smarty tag usage

Post by Dr.CSS »

Turn off tiny for GCB and put it in there then call GCB in content of page and you can then use tiny to do page edit...
christophera
Forum Members
Forum Members
Posts: 94
Joined: Sat Jun 06, 2009 10:43 pm

Re: Please help with smarty tag usage

Post by christophera »

Got it :)

Thank you all very much!  That did the trick.

Chris
Post Reply

Return to “Layout and Design (CSS & HTML)”