Page 1 of 1

CGContentUtils Multiselect Box problem

Posted: Sat Jul 06, 2019 8:29 am
by Simon66
I have created a Multiselect Box block in CGContentUtils.

It works perfectly with an option list in the options field:
Test 1|test_1
Test 2|test_2
Test 3|test_3
Test 4|test_4

It also works perfectly with this smarty generated list in the options field:

Code: Select all

{foreach item=i from=0|@range:9}
Test {$i}|test_{$i}
{/foreach}
But then I generate the same thing in a LISE instance and create a summary template called 'getItems':

Code: Select all

{foreach from=$items item=item}
{$item->title}|{$item->alias}
{/foreach}
And when I add this call in the Multiselect Box options field:

Code: Select all

{LISEinstancename template_summary='getItems'}
it doesn't work.
No options are generated in the content manager.

The same call on a page creates the key|value list perfectly.

As usual I assume I'm missing something simple.

Any ideas?

Cheers
Simon66

Re: CGContentUtils Multiselect Box problem

Posted: Sat Jul 06, 2019 2:19 pm
by calguy1000
That won't work because content blocks are processed differently.

Re: CGContentUtils Multiselect Box problem

Posted: Sat Jul 06, 2019 2:45 pm
by DIGI3
Try calling it with {cms_module module='LISEinstancename' template_summary='getItems'}

Re: CGContentUtils Multiselect Box problem

Posted: Sat Jul 06, 2019 2:54 pm
by calguy1000
I don't think that will work either. When the page template is compiled for use in the editor it uses a separate smarty instance that does not know anything about modules. Only the various {content_} plugins. This prevents side effects.

So module plugins, including {cms_module} will not execute.
And if it does work, I would not rely on it. as it is in fact a 'bug'.

Re: CGContentUtils Multiselect Box problem

Posted: Sat Jul 06, 2019 11:40 pm
by Simon66
Thanks guys,
I'm going to try a UDT to achieve the same thing.

Cheers
Simon66

Re: CGContentUtils Multiselect Box problem

Posted: Sun Jul 07, 2019 1:39 am
by Simon66
Digi3, I did try your solution. You also mentioned it in this post:
viewtopic.php?f=7&t=78619

It does work, and I'll just have to hope this 'bug' doesn't get fixed any time soon.

Cheers
Simon66