Jump to content

Multi Select Show database item


linkmat

Recommended Posts

Posted

Hi,

im working on a project and i try to figured out how to show Multiselect in IP.Page

i was try to use the same script for the bug tracker

{{if intval( $formValue ) === 1}}
	<span class='c4StatusBadge c4StatusBadge_upNext'>{$value}</span>
{{elseif intval( $formValue ) === 2}}
	<span class='c4StatusBadge c4StatusBadge_comingSoon'>{$value}</span>
{{elseif intval( $formValue ) === 3}}
	<span class='c4StatusBadge c4StatusBadge_future'>{$value}</span>
{{elseif intval( $formValue ) === 4}}
	<span class='c4StatusBadge c4StatusBadge_done'>{$value}</span>
{{endif}}

 but they didnt show individual :(  someone can help me

Posted

$formValue is only the correct call within the field’s custom code field. 

In a Pages template you need to call the field by it’s field id or field name. You find the latter in the field’s settings. 
The call will also depend on whether you are in a listing or record view template, e.g. $row->field_id or $record->field_id

Also that code will only work if your “multi-select” field really allows only one choice. 

Posted

yes with

{$record->customFieldDisplayByKey('my_key')|raw}

but they display all in the same box in the same color

what i want to do its  1 Choice 1 color in a multi select drop down

like  with ips_badge :

choice 1 = red

Choice2 = blue

choice 3 = orange

Choice 4 = orange

test.thumb.png.5a075581d4bde4d96587c46a8

but this is what i want to do but not only with  1 choice but  5 choice  and u cant select 5 choice ... this is  2 dropdown menu :)

 

 

Posted

yes with

{$record->customFieldDisplayByKey('my_key')|raw}

but they display all in the same box in the same color

​Sure, because the different options are merged to one string. You need to explode them first. ;-)

That was for images, but it’s the same principle for multi-select box results. 

Posted

its suppose to be like this ?

 

{{if $record->field_23} {{$fieldvalue = explode(',',$record->field_23);}} {{foreach}}

{{endforeach}}

{{endif}

 

sorry im a real NOOB in Php my strong thing is Css and html :(  and my english too its a bit poor

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...