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. Ellen Jensen
  2. F2C field types
  3. Wednesday, June 29 2016, 09:04 AM
  4.  Subscribe via email
Hi Patrick

I have previously used multi-select list array output successfully. But this time I can not get it to work.
I followed the legend of 111 complete (and it works on the other side with the same code) but it shows consistently IMAGE2.
And it does not matter whether it is "chopped" or not.

           
<div style="width: 60px; float:left">
{if is_array($ICON_IMAGE_VALUES)}
{if in_array('ROG', $ICON_IMAGE_VALUES)}
IMAGE1
{else}
IMAGE2
{/if}
{/if}

</div>



I use Joomla 3.5.1 and Form2Content 6.12.0

Regards, Ellen
References
  1. http://rilleit.dk/klitvej/index.php/rimhusene
  2. http://rilleit.dk/klitvej/administrator/index.php?option=com_form2content&view=form&layout=edit&id=52
Accepted Answer
F2C webmaster Accepted Answer Pending Moderation
Hi Ellen,

For future use try this:

{if array_key_exists('keyvalue', $FIELDNAME_VALUES)} .... your content ..... {/if}

where 'keyvalue' is the key value from your list.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C field types
  3. # Permalink
Responses (9)
Ellen Jensen Accepted Answer Pending Moderation
Maybe I have posted in the wrong category?
  1. more than a month ago
  2. F2C field types
  3. # 1
F2C webmaster Accepted Answer Pending Moderation
Hi Ellen,

Please use the correct syntax for the image array
http://documentation.form2content.com/images/stories/Form2Content_template_parameters.pdf

$< fieldname >_IMAGES}

Array with information about the images
in the gallery. The array elements are:
ALT, TITLE, FILENAME, WIDTH, HEIGHT,
WIDTH_THUMB, HEIGHT_THUMB

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C field types
  3. # 2
Ellen Jensen Accepted Answer Pending Moderation
I use that, and it was from the documentation, so I think it is right, But still dont work for me.

I tried simply inserting <IMAGE1> to test it.

The field is ticked = shown <IMAGE2>

The field blank = displayed <IMAGE2>

My fieldname are ICON_IMAGE

<div style="width: 60px; float:left">
{if is_array($ICON_IMAGE_VALUES)}
{if in_array('ROG', $ICON_IMAGE_VALUES)}
<img src="/images/icons/rog.jpg">
{else}
<img src="/images/icons/no-rog.jpg">
{/if}
{/if}

</div>


Or what exactly am I doing wrong?

Regards, Ellen
  1. more than a month ago
  2. F2C field types
  3. # 3
F2C webmaster Accepted Answer Pending Moderation
What are the values of your multi-select list?
If only one option why use multi-select list and not checkbox?
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C field types
  3. # 4
Ellen Jensen Accepted Answer Pending Moderation
My template

<div style="width: 60px; float:left">

<!--- Husdyr --->
<div style="width: 60px; float:left">
{if in_array('DYR', $ICON_IMAGE_IMAGES)}
11<img src="/images/icon/pets-allowed.jpg" style="margin:5px" class="icons-hus" title="Husdyr tilladt"/>{/if}
{if in_array('', $ICON_IMAGE_IMAGES)}
22<img src="/images/icon/pets-forbidden.png" style="margin:5px" class="icons-hus" title="Husdyr ikke tilladt"/>
{/if}
</div>
<!--- Rygning --->

<div style="width: 60px; float:left">
{if is_array($ICON_IMAGE_IMAGES)}
{if in_array('ROG', $ICON_IMAGE_IMAGES)}
røg
{else}
ingen røg
{/if}
{/if}
</div>

<!--- Internet --->

<div style="width: 60px; float:left">
{if is_array($ICON_IMAGE_VALUES)}
{if in_array('INTERNET', $ICON_IMAGE_VALUES)}
INTERNET
{else}
No internet
{/if}
{/if}

</div>
<!--- Spa --->
<div style="width: 60px; float:left">
{if in_array('SPA', $ICON_IMAGE_IMAGES)}
<img src="/images/icon/spa.png" style="margin:5px" class="icons-hus" title="Spabad"/>
{/if}
</div>
<!--- Sauna --->
<div style="width: 60px; float:left">
{if in_array('SAUNA', $ICON_IMAGE_IMAGES)}
<img src="/images/icon/sauna.png" style="margin:5px" class="icons-hus" title="Sauna"/>
{/if}
</div>
<!--- Vaskemaskine --->
<div style="width: 60px; float:left">
{if in_array('VASK', $ICON_IMAGE_IMAGES)}
<img src="/images/icon/vaskemaskine.png" style="margin:5px" class="icons-hus" title="Vaskemaskine og Tørretumbler"/>
{/if}
</div>
<!--- Opvaskemaskine --->
<div style="width: 60px; float:left">
{if in_array('OPVASK', $ICON_IMAGE_IMAGES)}
<img src="/images/icon/opvaskemaskine.png" style="margin:5px" class="icons-hus" title="Opvaskemaskine"/>{/if}
</div>



<!--- Indkøb --->
<div style="width: 60px; float:left">
<img src="/images/icon/shopping-basket.png" style="margin:5px" class="icons-hus" title="Indkøbsmuligheder"/>
<p style="font-size: 10px">
{if $INDKOB2}
{$INDKOB2}
{/if}
</p>
</div>
<!--- Strand --->
<div style="width: 60px; float:left">
<img src="/images/icon/strand.png" style="margin:5px" class="icons-hus" title="Strand"/>
<p style="font-size: 10px">
{if $STRAND2}
{$STRAND2}
{/if}
</p>
</div>
<!--- Havn --->
<div style="width: 60px; float:left">
{if $HAVUDSIGT}
<img src="/images/icon/havudsigt.png" style="margin:5px" class="icons-hus" title="Havudsigt"/>
{/if}


</div>


</td></tr></table>



See file.
Attachments (1)
  1. more than a month ago
  2. F2C field types
  3. # 5
Ellen Jensen Accepted Answer Pending Moderation
Okay, I'm doing 13 individual check boxes, so it works. Just wonder Multibselect works on my other side.
But never mind - thanks for the help.

Regards, Ellen
  1. more than a month ago
  2. F2C field types
  3. # 6
F2C webmaster Accepted Answer Pending Moderation
Hi Ellen,

That's a solution but I rather have this one work.

{if in_array('ROG', $ICON_IMAGE_VALUES)}

is correct. I thought you where talking about an image gallery.

ROG is a value I don't see.

Do none of your values work?
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C field types
  3. # 7
Ellen Jensen Accepted Answer Pending Moderation
No there was no place of them worked. All showed consistent image after <label> and not the first. And both that there was checkmark in the box and when there was not.
But now I have made them one instead. The check boxes. And it works fine.
So do not try more with it. The main thing is that there is something that works :-)
  1. more than a month ago
  2. F2C field types
  3. # 8
  • Page :
  • 1


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