Page 1 of 1
[SOLVED] How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:05 pm
by barboni
Hello,
I have an issue with something i suppose is related to smarty parsing. Well, I use Wookmark jquery and it requires this tag:
Code: Select all
<li data-filter-class='["some_class"]'>
. I use it inside News summary template by dynamically inserting "some_class", but
the problem is single quotes constantly being translated to double quotes, which i suppose is done by Smarty. The script won't work unless single quotes are outside the brackets and double quotes inside.
Is there anything I can do to make it work?
I have tried using literal, making UDT with php - but nothing changes, the double quotes are inserted even when no quotes are present in thecode.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:08 pm
by Rolf
{literal}{/literal}?
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:31 pm
by barboni
Tried it, it doesn't change anything. Double quotes are always there.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:35 pm
by Jo Morg
AFAIK it's not a Smarty parsing issue...
Are you using a WYSISYG? A code highlighter or anything of the sort?
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:36 pm
by barboni
Nope, I am using News template editor, no WYSIWYG. I said I just suppose it's a Smarty. I really am not sure what else could change the code.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:40 pm
by Jo Morg
Just for testing purposes, try inserting that code in a GCB with the WYSIWYG off and insert the GCB on a normal page template.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:49 pm
by barboni
Well, again single qoutes changed to double...
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:52 pm
by Jo Morg
Ok on my tests I ended up being able to reproduce, somewhat, that behavior. It seems that CMSMS or Smarty HTML encodes to
Code: Select all
<li data-filter-class="["some_class"]"></li>
I believe it's a CMSMS issue not a Smarty issue... but I'm doing a few more tests.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 3:52 pm
by velden
cmsms 1.11.9
News 2.14.1
In News summary template:
Code: Select all
<li data-filter-class='["some_class"]'>test</li>
Result (page source):
Code: Select all
<li data-filter-class='["some_class"]'>test</li>
So I don't think the data is changed somewhere in cmsms.
However, in Firebug:
Code: Select all
<li data-filter-class="["some_class"]">test</li>
I assume that doens't matter as that's interpretation of Firebug. But maybe, if Firebug interprets it this way, the browser/js does it too...
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 4:08 pm
by barboni
Yes, you're right, it's Firebug! But strange, I tested this outside CMSMS and it works only when quotes are correctly set, then again, it won't work inside CMSMS.
Well, thanks anyway, I'll keep on searching for solution.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 4:11 pm
by velden
barboni wrote:...then again, it won't work inside CMSMS.
Impossible.
Can you post a link to the page and describe the problem (what do you expect and what do you get)?
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 4:13 pm
by Jo Morg
Ok.... Tested on a different browser and there was no encoding whatsoever, meaning that my initial thoughts were wrong.
On IE all my tests, including a CGB, an UDT, directly on a template, and on a content etc worked as expected.
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 4:24 pm
by zaidcrowe
this may, or may not be helpful - but have you tried the isotope plugin for jquery? If i understand what wookmark does that is i think it's very similar and ive used it within cmsms no problems
http://isotope.metafizzy.co/
Re: How to bypass smarty parsing
Posted: Mon Mar 10, 2014 4:52 pm
by barboni
OK, I've found it! The issue with quotes confused me, so I thought that was the problem. Actually there was a tiny, almost invisible typo inside JS.
Sorry for false alarm, and thanks to everyone of you that tried to help. It's been 8 years since I started using CMSMS and I must tell that it really rocks, and no other system has so great and helpful community. Since I always find all the answers here I rarely use forum to post questions and now I'm a little embarrased
THANKS AGAIN!