Categories > TinyButStrong general >

Does'nt change a tagdelim inside joomla

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Eugeni
Date: 2011-09-20
Time: 18:38

Does'nt change a tagdelim inside joomla

Has to be something easy and stupid, but I can't find why this is not working... I think I've changed almost all the possibilities but this one has to be correct, hasn't it?

<td class="text">[t.mapa_prod;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/[val]" />']</td>

the [val] it changes, but the [t.id_producte] it does not. So in the web it gets: <img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/mapa.jpg">

In other cases, it also worked perfect:

i.e. [s.img_et;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/[s.id_prod]/etapes/[s.etapa].jpg" it gets the correct path and the img is displayed.

Anyone knows why?

Thanks
By: Skrol29
Date: 2011-09-20
Time: 23:00

Re: Does'nt change a tagdelim inside joomla

Hi Eugeni;

(edited post)

Note that the parameter :
if [val]=''
can produce bad results if the value [val] may contain symbols like "=" or "'". This is because the value is replaced in the expression, and then the expression is evaluated.

So, it's safer to code:
if '[val]'=''


Nevertheless, there is simplest code for what you are trying to do:
<td class="text">[t.mapa_prod;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/[val]" />']</td>
is the same as:
<td class="text"><img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/[t.mapa_prod;magnet=img]" /></td>
By: Eugeni
Date: 2011-09-21
Time: 17:43

Re: Does'nt change a tagdelim inside joomla

Thanks. It worked.

But why did not worked the other one? the sintax was correct, wasn't it? and the field value is or empty or just text... I changed it and used if '[val]'='' and it did not worked also.
By: Skrol29
Date: 2011-09-22
Time: 15:04

Re: Does'nt change a tagdelim inside joomla

Do you know the exact value that is merged ?
By: Eugeni
Date: 2011-09-23
Time: 01:17

Re: Does'nt change a tagdelim inside joomla

In this case "mapa.jpg"
By: Skrol29
Date: 2011-09-23
Time: 03:08

Re: Does'nt change a tagdelim inside joomla

Sorry, I'm a bit lost: which snippet is not working with value "mapa.jpg" ?

Do you also check the value of [t.id_producte] ?
By: Eugeni
Date: 2011-09-23
Time: 17:19

Re: Does'nt change a tagdelim inside joomla

Hi Skrol! First of all, thanks for everithing! I really appreciate that!

I tell you, the problem is that, no matter what value they get, if I put both fields together, it doesn't work, but if I put only one, any one, it works and it replaces de field with the value it gets from the query:

Case 1: <td class="text">[t.mapa_prod;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/9/[val]" />']</td>
works <img src="/treknwalk/images/stories/imatges/productes/9/mapa.jpg" />

Case 2: <td class="text">[t.mapa_prod;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/mapa.jpg" />']</td>
works <img src="/treknwalk/images/stories/imatges/productes/9/mapa.jpg" />

Case 3: <td class="text">[t.mapa_prod;if [val]='';then '';else '<img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/[val]" />']</td>
DOES NOT WORK: <img src="/treknwalk/images/stories/imatges/productes/[t.id_producte]/[val]" />

And that's what I don't understand!
By: Bruce Decker
Date: 2011-11-02
Time: 23:47

Re: Does'nt change a tagdelim inside joomla

I experienced a similar problem.  I was using the Joomla JCE WYSIWYG editor to edit a Joomla article with TBS tags.  Everything works but I decided to try to create a hyperlink using the 'link' widget in the JCE editor.  When I enter the URL to the hyperlink into the URL field, I entered:  /scanned_images/[scanned_filename].pdf.

When it renders, it does not swap the [scanned_filename] tag with the value.

If I place the same tag into the article, it shows the proper value.

What I discovered is that if I edited the article code by selecting the '<>code' button in JCE, that the widget for editing the hyperlink was swapping the delim character '[' with the URL encoded value of %5D.  When I hacked the %5D back to the [ character and saved it, the replacements worked just fine.  I'm still trying to figure out how to fix this. 

1) If I hack JCE so that it does not encode the URL, I may break something
2) If I hack the TBS class to find either the delim character [ or %5D, then I may end up in a situation where TBS swaps something in the content unintended.

Has anyone else run into this and what is their recommendation?

Thanks,

Bruce Decker
Colorado