Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Francesc
  2. Form2Content KML Feeds extension
  3. Monday, 23 January 2017
  4.  Subscribe via email
Good morning Patrick,

I am having and Issue trying to finish my template. I commented this in a point in my previous post.

I created a Single Select List Field named {$ESTADO}.

It has 4 "Option Values" with each "Option Display Text". Please check the attached image...

And This is my smarty code based on yours :


{if $ESTADO =='EnObras'}
<styleUrl>#obras</styleUrl>
{elseif $ESTADO =='Construido'}
<styleUrl>#construido</styleUrl>
{elseif $ESTADO =='Propuesta'}
<styleUrl>#propuesta</styleUrl>
{elseif $ESTADO =='Concurso'}
<styleUrl>#concurso</styleUrl>
{/if}


Why can not make the <styleurl> to show?
Since some values and text are the same I can tell it doesn t work with both selectors.

What can I do to solve this?

Thank you for the patience you had with me...
Attachments (1)
Responses (9)
Accepted Answer Pending Moderation
Mmmhhh, this code looks OK and the values are different. Can you check that:
1) Selections have been made in the forms.... just to be sure ;)
2) The output without the IF statement, to know that the values actually output (ie no typo)
3) Test with just {if}{/if} per value. Don't ask why but I found that that sometimes does work.

I know we developed our own Smarty modifier at some point. You could give that a try also.
http://documentation.form2content.com/f2c-tips-and-tricks/f2c-smarty-code-snippets/44-checking-a-field-for-a-value-if-contains

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
Accepted Answer Pending Moderation
ok ... I got something...

I can confirm {$ESTADO} calls the "option value" not the text.

I put {$ESTADO} in the description just to check what value is... and now the styleurl is showing as it should.

If I remove the field {$ESTADO} from description the "{/if}" stop working... styleurl stop to appear.

In other words ... putting the field {$ESTADO} somewhere and the {/if}´s works perfect... without {/if} don t work ...

I tried also with no succes this as you said:


{if $ESTADO =='EnObras'}
<styleUrl>#obras</styleUrl>
{/if}
{if $ESTADO =='Construido'}
<styleUrl>#construido</styleUrl>
{/if}
{if $ESTADO =='Propuesta'}
<styleUrl>#propuesta</styleUrl>
{/if}
{if $ESTADO =='Concurso'}
<styleUrl>#concurso</styleUrl>
{/if}


Thank you again
Accepted Answer Pending Moderation
The output is as per documentation always the VALUE. For TEXT you need to add the _TEXT to the template parameter.

I don't understand: "In other words ... putting the field {$ESTADO} somewhere and the {/if}´s works perfect... without {/if} don t work ..."

Do you mean that the above code to render the different styleURL with the {if} statements only works if you render the {$ESTADO} somewhere in your template? This would be very (very) strange.... You are sure it's not a cache issue? So render the feed without caching and clearing browser cache.
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
Accepted Answer Pending Moderation
Yes ... this is exactly what happens ... when {$ESTADO} is somewhere in the template the if statements works perfectly. If is not present it stops working... I am sure is nothing about cache by the way...

I think I am gonna cry ... This never happened before?
Accepted Answer Pending Moderation
it's just code, not worth crying over ;)

For now simply add <div style="display:none;">{$ESTADO}</div>. This should make it work while we see if we can reproduce the issue.
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
Accepted Answer Pending Moderation
Was joking of course :p ... But Always strange things happened to me ...
I used million times if statements in f2c pro and of course this never happens...
I am using 6.13 ... just for the record... maybe it s related...

Will use this for a solution for a while... Feel free to enter in my site to check if necessary of course...

Thanks for your time
Accepted Answer Pending Moderation
Hello Francesc,

Can you please send me an export of the Content Type plus the template you are using?
I will see if I can reproduce your situation.

best,
Julien
Accepted Answer Pending Moderation
Hi.
Here you have attached...
Thanks!
Attachments (2)
Accepted Answer Pending Moderation
Hi,

For some reason I can't download the placemarker template file?
Can you please send it to julien at opensourcedesign dot nl ?

Thanks!

best,
Julien
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.