Adding a Custom Block Space

Adding a Custom Block Space

by James Cracknell -
Number of replies: 5

I am trying to add a Custom HTML: Block into Aardvark - so I can format it differently using CSS.  CSS is present. #topleftblock

I've created one called 'topleftblock' 

On frontpage I've added:

'frontpage' => array(
'file' => 'frontpage.php',
'regions' => array('side-pre','search','topleftblock','homeblock'),
'defaultregion' => 'side-pre',
),

And just where do I add 

<div class="region-content"><div id="topleftblock">
<?php echo $OUTPUT->blocks_for_region('topleftblock') ?>
</div>

because I've tried adding it in different places and it isn't working.

CSS for the record is 

#leftlinks {
background: #000;
width: 250px;
height: 250px;
float: left;
margin-right: 20px;
margin-top: -13px;
}

I know the CSS will need working on - but can't see any reason why I can't select the block.

If there is another "easier" way to go about this - please let me know!

Average of ratings: -
In reply to James Cracknell

Re: Adding a Custom Block Space

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

this is wrong for a kick-off

<div class="region-content"><div id="topleftblock">
<?php echo $OUTPUT->blocks_for_region('topleftblock') ?>
</div>

Should be...

<div id="topleftblock" >

<div class="region-content">
<?php echo $OUTPUT->blocks_for_region('topleftblock') ?>
</div>

</div>

Hwever...if you want to just ADD a HTML block why not just use ADD BLOCK and choos HTML from that?

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Adding a Custom Block Space

by James Cracknell -

Hi Mary

I want to add an HTML block - do some custom CSS with that block and not impact on other HTML blocks.  Is there an easier method?

J.

In reply to James Cracknell

Re: Adding a Custom Block Space

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

It depends largely on the content of the HTML block

Because it IS an HTML block you can add your own HTML in it.

Also to make it work you HAVE to give it a Title else it wont function correctly

Once in place you can add something like...

<div id="leftlinks">
<ul>
<li><a href="" >Link </a></li>
<li><a href="" >Link </a></li>
<li><a href="" >Link </a></li>
<li><a href="" >Link </a></li>
</ul></div>

using the test edito in HTML format

HTH

Mary

In reply to Mary Evans

Re: Adding a Custom Block Space

by James Cracknell -

I can also get the block to appear on the right hand side but not the left.....

I also find I can't edit the block contents now.....arrrrrrrgghhhh

In reply to James Cracknell

Re: Adding a Custom Block Space

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

There are two editing options for Blocks

one is to edit block settings and one is to edit block content

I wish I had more time to help you but don't

Sorry