SOLVED: Showing title in new global content block

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
WebBunyip

SOLVED: Showing title in new global content block

Post 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.
Last edited by WebBunyip on Sat Jul 12, 2008 11:54 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Showing title in new global content block

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Showing title in new global content block

Post 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"}
WebBunyip

Re: Showing title in new global content block

Post 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.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Showing title in new global content block

Post 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
WebBunyip

Re: Showing title in new global content block

Post by WebBunyip »

Thanks Nullig.

Knew I was missing something silly.

Works fine now.

Thanks all.
Locked

Return to “CMSMS Core”