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

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Link LISE items to Menu
PostPosted: Sun Jun 24, 2018 7:17 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 11, 2009 4:35 pm
Posts: 466
Hi,

I've a LISE-module and want to link every item to its own content-page.

It's for a medical-website where every treatment has it's own page and where every treatment also has a certain specialist (a person). Those specialists are listed in a LICE-instance.

I know it's possible to add a 'content page field definition', but a want to do it the other way arround. So I want to achieve a dropdown or somekind while editing a contentpage were I could select a LISEitem (the person/specialist).

What is the easiest way to achieve this?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link LISE items to Menu
PostPosted: Sun Jun 24, 2018 9:19 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2985
Location: The Netherlands
Just an idea: wouldn't it be possible to use LISE as a replacement for the specific content pages?

There are ways to 'insert' LISE links into the menu.

If not I would have a look at http://dev.cmsmadesimple.org/projects/ecb2 and create a UDT to fill the dropdown_from_udt content block.

The LISE api allows for creating such an UDT or it could be a rather simple database query too. I don't have a working example though.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link LISE items to Menu
PostPosted: Sun Jun 24, 2018 9:22 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 11, 2009 4:35 pm
Posts: 466
velden wrote:
...
There are ways to 'insert' LISE links into the menu.
..

How could this be done? ;D


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link LISE items to Menu
PostPosted: Sun Jun 24, 2018 9:33 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 338
Location: Victoria, BC
You can use CGContentUtilties to create a dropdown that displays a list of your LISE items. In CGCU create a dropdown block called 'lise_items' and put this in the 'options' field (replace [instance] with your instance name):

Code:
{cms_module|strip_tags module='LISE[instance]' template_summary='options'}


Then in your LISE instance, create a summary template called 'options':

Code:
{foreach from=$items item=item}
{$item->name}|{$item->alias}
{/foreach}


Then in your page template:

Code:
{content_module module='CGContentUtils' block='lise_items'}


I'm going from memory so the above may not be exactly right, but it should be pretty close.

_________________
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 LISE items to Menu
PostPosted: Sun Jun 24, 2018 9:33 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2985
Location: The Netherlands
Create a LISE summary template that outputs the html like you need it for your menu.

Inside the Navigator template create some logic to find the right place in the menu and insert a LISE tag with the specific template there.

Challenge will be to give a specific LISE item a 'current' or 'active' class when it's the selected 'page'. But not impossible.


Another option would be http://dev.cmsmadesimple.org/projects/cgsmartnav


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link LISE items to Menu
PostPosted: Mon Jun 25, 2018 9:12 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 11, 2009 4:35 pm
Posts: 466
DIGI3 wrote:
You can use CGContentUtilties to create a dropdown that displays a list of your LISE items. In CGCU create a dropdown block called 'lise_items' and put this in the 'options' field (replace [instance] with your instance name):

Code:
{cms_module|strip_tags module='LISE[instance]' template_summary='options'}


Then in your LISE instance, create a summary template called 'options':

Code:
{foreach from=$items item=item}
{$item->name}|{$item->alias}
{/foreach}


Then in your page template:

Code:
{content_module module='CGContentUtils' block='lise_items'}


I'm going from memory so the above may not be exactly right, but it should be pretty close.

This works great so far!
And how can I access the other fields of the lise-item? I could do something like this;
Code:
{capture assign="foo"}{content_module module='CGContentUtils' block='lise_items'}{capture}
 {LISE[instance] item='$foo' template_detail='page-view'}

But I rather have the fields available in the page-template itself, instead of making a detail-template in the LISE instance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Link LISE items to Menu
PostPosted: Mon Jun 25, 2018 10:07 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 338
Location: Victoria, BC
You could create a detail template that assigns all of the fields to variables, which you can then call from within your page template anywhere after the lise call.

Also, try to avoid {capture}, it's more efficient to assign variables.

Code:
{$foo="{content_module module='CGContentUtils' block='lise_items'}"}

_________________
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 LISE items to Menu
PostPosted: Tue Jun 26, 2018 7:36 am 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2985
Location: The Netherlands
Quote:
And how can I access the other fields of the lise-item? I could do something like this;
Code:
{capture assign="foo"}{content_module module='CGContentUtils' block='lise_items'}{capture}
{LISE[instance] item='$foo' template_detail='page-view'}

You could but it wouldn't work :-) Don't use variables inside single quotes, they won't be evaluated. Preferably don't use quotes at all around variables (and tags).

So, about this 'variables' being accessible in the page template. Consider this:

Create a LISE detail template (name 'empty') with only this code:
Code:
{$LISEitem=$item scope=global}


Then in your page template, AFTER the

Code:
{content_module module='CGContentUtils' block='lise_items' assign=foo}

(note the assign parameter, obviously the best and easiest way to assign the output to a variable in this case)

Code:
{LISEinstance item=$foo template_detail=empty action=detail assign=dummy}


assign=dummy is optional because the 'empty' template should not output anything anyway.

Now you can use in your page template the $LISEitem OBJECT like you would inside the LISE detail template itself (but use $LISEitem instead of $item).

E.g.:

Code:
$LISEitem->title
$LISEitem->fielddefs['<FIELDDEF_ALIAS>']->value


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  [ 8 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:  
A2 Hosting