Page 1 of 1

Content block default not working

Posted: Mon Jan 30, 2017 4:03 pm
by spcherub
I am trying to set a default value for an additional content block using this syntax:

Code: Select all

{content block="more_copy" assign="more_copy" label="More Copy" default="This is default copy for this additional field" oneline="true"}
However, the default copy does not show up in the page editor. What am I doing wrong? I am on 2.1.6.

TIA
Sanjay

Re: Content block default not working

Posted: Mon Jan 30, 2017 4:25 pm
by Rolf

Re: Content block default not working

Posted: Mon Jan 30, 2017 4:40 pm
by spcherub
@Rolf - the problem is not with using the variable that is assigned in the content block. It is that the "default" parameter is not working - it does not pull in the string I put in as the default.

Are you saying that the scope also has to be assigned for the "default" parameter to work?

Thanks,
Sanjay

Re: Content block default not working

Posted: Tue Jan 31, 2017 11:46 am
by paulbaker
Mmmmm, I tested your code (and variations of it) and I couldn't get the default text to show, either. Possible bug unless I am misunderstanding something? Looks like your code is correct from here:
https://docs.cmsmadesimple.org/tags/cmsms-tags/content

Re: Content block default not working

Posted: Tue Jan 31, 2017 1:17 pm
by chrisbt
Not perfect but you could try:

Code: Select all

{content block="more_copy" assign="more_copy" label="More Copy"  oneline="true"}
{$more_copy=$more_copy|default:"This is default copy for this additional field" scope=global}

Re: Content block default not working

Posted: Tue Jan 31, 2017 1:24 pm
by spcherub
@chrisbt: That looks like a good workaround while the bug is being worked out. I will try it out and report back.

Thanks!

Re: Content block default not working

Posted: Tue Jan 31, 2017 1:30 pm
by spcherub
Just realized that one downside of that workaround is that the editor will not notice that there is default text when in the editor. Or be able to start with the default text and make small adjustments.