Hello community,
I know there is a "default" keyword for content blocks, which allows you to enter the default text... this is exactly what I'm after, but it won't let me add...
{content block="whatever" default='<div class="hi">Hello</div>'}
It doesn't matter that I've changed the double quotes to single... I can't insert double quote content in there...
Is there an effective way to have default HTML content?
Thanks!
Content Block "Default" Text
Re: Content Block "Default" Text
Doesn't seem like that method will work. You'd be better off testing to see if the block is emtpy, and if so, outputting the div:
{content block=whatever assign=foo}{if $foo == ''}<div class="hi">Hello</div>{/if}
{content block=whatever assign=foo}{if $foo == ''}<div class="hi">Hello</div>{/if}
Re: Content Block "Default" Text
Hello intomalakas
Try something like this:Grtz. Rolf
Try something like this:
Code: Select all
{capture assign=foo}<div class="hi">Hello</div>{/capture]
{content block="whatever" default=$foo}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- New Member
- Posts: 3
- Joined: Thu Jul 12, 2012 12:21 pm
Re: Content Block "Default" Text
Thanks to the both of you for your prompt replies.
Both solutions are, indeed correct in the context they are for.
I should clarify my requirements a little more, sorry I failed to mention that I would like this default content to first appear in the content editor box in the admin section.
That is, when I create a new page, I would like the content blocks to be pre-populated with content that I pass in through the "default" parameter.
I tried the above, but it did not work.
Is this at all possible?
Both solutions are, indeed correct in the context they are for.
I should clarify my requirements a little more, sorry I failed to mention that I would like this default content to first appear in the content editor box in the admin section.
That is, when I create a new page, I would like the content blocks to be pre-populated with content that I pass in through the "default" parameter.
I tried the above, but it did not work.
Is this at all possible?
Re: Content Block "Default" Text
Yeah, I understand what you mean. I hoped with my suggestion it should work.
But I talked to Calguy just now and it does't work this way, I'm afraid. We have to clarify this in the helptext...
{content block="name" default=$foo} is NOT valid.
{content block="name" default="<p>Default text</p>"} is the only correct methode, but has its limitations...
But I talked to Calguy just now and it does't work this way, I'm afraid. We have to clarify this in the helptext...
{content block="name" default=$foo} is NOT valid.
{content block="name" default="<p>Default text</p>"} is the only correct methode, but has its limitations...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- New Member
- Posts: 3
- Joined: Thu Jul 12, 2012 12:21 pm
Re: Content Block "Default" Text
Yeah, looks like it can't be done... shame though.
I'll take a stab at making a module or some sort of alteration to make this work for myself. If I succeed, I'll let you know.
I'll take a stab at making a module or some sort of alteration to make this work for myself. If I succeed, I'll let you know.