[SOLVED] Can you call smarty code in the Pages content area?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
NicoCollu
Forum Members
Forum Members
Posts: 34
Joined: Sun Sep 30, 2012 8:05 pm

[SOLVED] Can you call smarty code in the Pages content area?

Post by NicoCollu »

Hello.

I'm wondering if it's possible to add smarty code into the page content WYSIWYG HTML editor.

To clarify, here is an example:
I want to call this code in the Pages content area. I have switched HTML view.

Code: Select all

<literal><div id="disquscomments">
{capture name=xxx assign=sid}news_{$entry->id}{/capture}{disqus comments=$sid}
</div></literal>
I also tried putting the literal code to surround just the smarty code. I also tried

Code: Select all

{literal}
code.

It doesn't work at all now and calls an error page when I reload the page.

At one point it worked, but then I went into change some things in the editor and it didn't work at all after that...

Also, when I press: "Apply", it removes the literal commands.

Thank you!
Last edited by NicoCollu on Thu Oct 11, 2012 12:21 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Can you call smarty code in the Pages content area?

Post by calguy1000 »

short answer: yes

slightly longer answer: don't mix design code and content code, disable the wysiwyg for pages with design in them,

even longer answer: <literal> is not a valid tag. In HTML, or in smarty. {literal} is a smarty tag that turns off all smarty interpreting of the contents until {/literal} is encountered.

You need to read the documentation for the tags you are using, and the smarty documentation in general.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
NicoCollu
Forum Members
Forum Members
Posts: 34
Joined: Sun Sep 30, 2012 8:05 pm

Re: Can you call smarty code in the Pages content area?

Post by NicoCollu »

calguy1000 wrote:short answer: yes

slightly longer answer: don't mix design code and content code, disable the wysiwyg for pages with design in them,

even longer answer: <literal> is not a valid tag. In HTML, or in smarty. {literal} is a smarty tag that turns off all smarty interpreting of the contents until {/literal} is encountered.

You need to read the documentation for the tags you are using, and the smarty documentation in general.
Hey!

Yeah, I just read the {literal} smarty documentation and see that what I was trying to do was idiotic.

Is there a thread where the short answer is explained in detail?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Can you call smarty code in the Pages content area?

Post by Dr.CSS »

When you are trying to put code like that in a page it is sometimes better to put it in a GCB with editor turned off then use that in the "Content'...
NicoCollu
Forum Members
Forum Members
Posts: 34
Joined: Sun Sep 30, 2012 8:05 pm

Re: Can you call smarty code in the Pages content area?

Post by NicoCollu »

Dr.CSS wrote:When you are trying to put code like that in a page it is sometimes better to put it in a GCB with editor turned off then use that in the "Content'...
Thank you! This works perfectly for my purpose!
Post Reply

Return to “The Lounge”