Page 1 of 1

Advanced Content default smarty value dropdown

Posted: Sun Mar 02, 2014 8:19 pm
by mebots
Hello,

Have made the following advanced content block:

Code: Select all

{content block="block_3" label="Sidebar menu" page_tab="Blokken" block_type="dropdown" sortable="true" items=":::get_gcb_list allowed_group='Admin':::" default="`$root_page_alias`_sidebar_menu" assign="block_3" smarty=true}
The items worked.

But the default value doesn't work.

$root_page_alias is for example "contact", why can't I make it like

"contact_sidebar_menu" as default?

Can I use smarty in default?

Martijn.

Re: Advanced Content default smarty value dropdown

Posted: Mon Mar 03, 2014 1:51 am
by JohnnyB
default="`$root_page_alias`_sidebar_menu"
With new Smarty ver 3 that the CMSMS versions 1.11++ use, you don't need the `` chars around the smarty stuff.

Also you will need to either capture the values you are trying to put together first and assign it as a var to put into the tag or try to use the |cat modifier to join them together.

http://www.smarty.net/docs/en/language. ... apture.tpl
http://www.smarty.net/docs/en/language.modifier.cat.tpl

Is $root_page_alias an actual var?
$page_alias is and usually I use the CGSimpleSmarty method of getting the parent or root of a page.

Re: Advanced Content default smarty value dropdown

Posted: Mon Mar 03, 2014 6:00 am
by Rolf
http://docs.cmsmadesimple.org/tags/core/content
default - Allows you to specify default content for this content block (additional content blocks only). You can't use a smarty string here!
So {content block="third_content_block" default=$foo} is NOT valid