Call multiple selct field in a template

More
10 years 4 months ago #47885 by shinji
Hello,

I'm trying to insert a call to a multiple select field in my joomla template among this :
Code:
<?php if($basic_catid != 84 && $basic_catid != 86) { ?> <div class="middle alignleft"> <span id="art_id" style="display:none" rel="<?php echo JRequest::getInt('id'); ?>"></span> <div class="tab_content cat_0 active"> <?php if(isset($ct_array['pres_secteur'])){ echo "<h1>Secteur</h1><p id='secteur'>".$ct_array['pres_secteur']."</p>"; echo "<br/>"; } if(isset($ct_array['pres_lieu'])){ echo "<h1>Lieu de r&eacute;alisation</h1><p id='lieu'>".$ct_array['pres_lieu']."</p>"; echo "<br/>"; } .....

For exemple "pres_secteur" is a multiple select field. But i only display the first seclect (because that's what i'm asking)
Searching for the correct way to call a multiple select field i found :
Code:
<?php foreach ($this->item->positions['pres-secteur'] as $field) : ?> <?php echo $field->label; ?><br /> <?php echo $field->display; ?> <?php endforeach; ?>

But i can't insert it correctly i guess. Any clue to insert multiple select field in my previous code as simply as possible?
Is the code i found correct to call a field from joomla template?
Regards,

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #47914 by ggppdk
Hello

what do you mean ?

is ->display empty ??

then please add field to a template position ,
e.g. "renderonly"

thus field's display HTML will get created


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #48029 by shinji
Hello,

I think it's just a syntax problem. The first code i show is working correctly to display a unique value field.
I'm just trying to enhance it to show a multiple select field.
The second code i showed should work correctly to display multiple select field.

I'm just trying to implement it in :
Code:
if(isset($ct_array['pres_secteur'])){ echo "<h1>Secteur</h1><p id='secteur'>".$ct_array['pres_secteur']."</p>"; echo "<br/>"; }

I tryed a ton of different ways, but still display nothing, just blank.
Could you give me an exemple, i don't understand the correct way to display it.

Regards

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.377 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline