• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Link multiple LISE items to a page
PostPosted: Mon Oct 08, 2018 9:43 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 11, 2009 4:35 pm
Posts: 478
I've had a previous question about LISE in this topic but unfortunately it's closed now.

I've managed to display a single LISE item at a content page using CGContentUtilities, where it's possible to select the item while editing the page itself.

But now my client wants the possibility to display multiple items at one page. I've changed the CGCU dropdown into an 'multiselection' , which works fine for selection, but I don't know how to proceed at the page-template to display the info of 2 or more items.

Snippet of the page template;
Code:
<div class="card-body">
{content_module module='CGContentUtils' block='team_items' assign=specialist}
{LISETeam item=$specialist template_detail=empty action=detail}
{capture assign="teamfoto"}uploads/images/team/{$LISEitem->foto}{/capture}

<div class="row">
<div class="col-lg-5 no-padding-right">
<img src="{CGSmartImage src=$teamfoto filter_croptofit="250,250,c" notag=1 noembed=1}" class="img-fluid rounded-circle"/>
</div>

<div class="col-lg-7 extrapadding">
<h3>{$LISEitem->title}</h3>
<span>{$LISEitem->fielddefs['achternaam']->value}</span>
</div>
</div>
</div>


Do I need to implement some kind of {foreach} array?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link multiple LISE items to a page
PostPosted: Mon Oct 08, 2018 10:47 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 716
Location: Victoria, BC
For a detail template, yes foreach would be best.

If you want to do a summary template instead, You should be able to implode the array:
Code:
{LISETeam include_items="{','|implode:$specialist}" template_summary='foo'}


(note, this assumes it's an array coming from CGCU, if it's just a csv then you don't need the implode and can just include_items=$specialist. I couldn't remember off-hand which it was)

Unrelated, try to assign variables directly instead of using capture, it's more efficient:
Code:
{$teamfoto="{uploads_url}/images/team/{$LISEitem->foto}"}

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link multiple LISE items to a page
PostPosted: Thu Oct 18, 2018 7:38 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 11, 2009 4:35 pm
Posts: 478
DIGI3, thanks!

It works like a charm! One thing which was a bit confusing; I've used a multiselect box from CGCU, so I thought I should use the 'implode' option, but I had to use the csv-one instead. Could you explain why?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link multiple LISE items to a page
PostPosted: Thu Oct 18, 2018 11:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 716
Location: Victoria, BC
I think csv is standard for multiselect results. They could be assigned to an array, but if it's not needed then it's easier to have it as a csv for simple form processing.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Hosting Nation - Managed CMSMS Hosting