Page 1 of 1
SOLVED: Showing title in new global content block
Posted: Sat Jul 12, 2008 11:24 am
by WebBunyip
Hi all.
I am trying to create a new glbal content block.
Have created the block in admin with no problems.
The content block is showing on the page that {content block='new-content-block'} and I can edit the content in admin for that page.
The problem is that I do not know how to add a title to this content block. I cannot see any provision for it in admin.
What am I missing.
Thanks.
Re: Showing title in new global content block
Posted: Sat Jul 12, 2008 2:06 pm
by Nullig
You add the title in your template, like:
{* Start Content Area 2 *}
Content Two Title
{content block="content-block-2"}
{* End Content Area 2 *}
Nullig
Re: Showing title in new global content block
Posted: Sat Jul 12, 2008 5:19 pm
by Dr.CSS
And if you want to change the Title every time you add content, like a diff. title for diff. pages...
{content block="block2title" oneline="true"} this will give you a one line edit box to put the title in...
{content block="content-block-2"}
Re: Showing title in new global content block
Posted: Sat Jul 12, 2008 10:39 pm
by WebBunyip
mark wrote:
And if you want to change the Title every time you add content, like a diff. title for diff. pages...
{content block="block2title" oneline="true"} this will give you a one line edit box to put the title in...
{content block="content-block-2"}
Thanks guys.
I have done that mark.
It is quoting everything in the text box that has been placed in admin.
I am using the wireframe 3col as a base for the template.
The thing that I am wondering is that when I go to edit the page in admin, the blocks such as news, news2, block2, has an area where you can enter the block title, as well as the general text box.
The content block I created shows the text box in admin on the page I am trying to edit, but not a title field.
I tried the following.
This is the code in the template index file
Code: Select all
<div id="newblockbox">
<div id="boxheader">
<h2>{content block='newblock' oneline='true'}</h2>
</div>
<div id="newblock">
{content block='newblock'}
</div>
</div>
I have added the extra div so a different background color can be used in the header.
I tried by editing the first line in the text box as the heading for the block and then the rest of the text starting on a new line. It showed all the text in the header, rather than just the first line.
I know I am missing something silly.
Thanks again for your help.
Re: Showing title in new global content block
Posted: Sat Jul 12, 2008 11:08 pm
by Nullig
Yes, you can't have the same "name" for each block.
Change this:
{content block='newblock' oneline='true'}
to:
{content block='newblocktitle' oneline='true'}
Nullig
Re: Showing title in new global content block
Posted: Sat Jul 12, 2008 11:54 pm
by WebBunyip
Thanks Nullig.
Knew I was missing something silly.
Works fine now.
Thanks all.