Calling Items in AdvancedContent Blocks

Postdate: March 14 2012
Category: External Integration
Applies to: 2.x

If you want to attach an item from a module to a content page in a userfriendly way, AND you are familiar with AdvancedContent, there is an easy way doing so.


I created a plugin that reads items or categories from the database flelds of a module and serves it to AdvancedContent to populate a Select-Dropdown where you or a user easily can select an item from it.

Get the plugin » 

As an example...

...I use a module(Kontakt) that handles contact information about employees. If you want to attach one of the teammembers to a specific page and you already setup the content block:

It will look like this:

Selectfield

The corresponding content block in your page template:

{AdvancedContent block="Kontakt" label="Auswahl Kontakt" 
block_type="dropdown" 
allow_none=true 
items="Kein Kontakt|:::get_items what='title' mod='Kontakt' level='item' :::" 
values="|:::get_items what='alias' mod='Kontakt' level='item' :::" 
smarty=true 
assign="showkontakt" 
page_tab="Settings"}

The item then is called as follows:

{if $showkontakt}
{cms_module module='Kontakt' what='kontakt' alias=$showkontakt}
{/if}

Words in strong green are values/parameters that need be adjusted according to the values of your module!