Content block default not working

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Content block default not working

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Content block default not working

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Content block default not working

Post 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
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: Content block default not working

Post 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
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 181
Joined: Sun Sep 05, 2010 6:11 am
Location: Sheffield, UK

Re: Content block default not working

Post 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}
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Content block default not working

Post 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!
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Content block default not working

Post 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.
Locked

Return to “CMSMS Core”