Page 1 of 1

Producing a sortable list by ECB from LinkMgr

Posted: Thu Sep 18, 2014 12:55 pm
by Guido
Hi,

I am trying to add a content block to my page template via ECB. I want it to be a sortable list, which retrieves its values from the Link Mgr module. I tried making a UDT, tried assigning the values from the LinkMgr call to a value and then passing it on to the ECB content block call, but it always remains empty.

When I use "print_r" on the var I create (or just call the UDT), it produces the comma separated list I want, but somehow ECB doesn't like it. Anyone have any thougts on this?

I know I could use Advanced Content for this, but this is a too heavy-weight module for what I'm trying to do in my opinion.

An example:

Code: Select all

{content_module module="ECB" field="sortablelist" block="testsortablelist" label="Test lijstsortering" values=test1=Test 1,test2=Test 2}
Works as expected, but

Code: Select all

{assign var='list' value="test1=Test 1,test2=Test 2"}
 {content_module module="ECB" field="sortablelist" block="testsortablelist" label="Test lijstsortering" values=$list}
doesn't.

Re: Producing a sortable list by ECB from LinkMgr

Posted: Thu Sep 18, 2014 3:06 pm
by velden
Seems like assign a smarty variable in a template does not work well for using in the backend.

Consider using a UDT and and use the udt parameter?

Re: Producing a sortable list by ECB from LinkMgr

Posted: Thu Sep 18, 2014 3:29 pm
by Guido
Thanks for your reply.

I did create a UDT, but ran into the same problem. I designed the UDT so it would output the same comma separated list. I'm not sure if this is the way to go, since for a different field selector the developer requires an array when you use the 'udt' method.

For the sortable list however, there are no specifications in the help. And, moreover, I suck too much at programming to create an array from a UDT ;)