how can i make a before content block of featured content block on this theme http://infospill.com/

Comments

infospill’s picture

or how do i just add content blocks? the one i really want is the before content block tho. please help

yuriy.babenko’s picture

What you need to do is create a new "region" and add your block to it. Here's a tutorial: http://yubastudios.com/blog/drupal-creating-new-regions
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com

infospill’s picture

thanks buddy. People like you make me happy!

infospill’s picture

ok so i added the regions in the info file and i cleared registry

The blocks showed but when I save the block in the top content the content is not visible on my homepage?

i see you have a update that i need to add more stuff to the page.tpl.php where is that located? i cannot find it!

yuriy.babenko’s picture

The page.tpl.php file is within your theme's folder. Usually either /themes/themename/page.tpl.php or /sites/all/themes/themename/page.tpl.php.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com

infospill’s picture

the file page.tpl.php is not there i looked all over the place only bluemarine and garland themes carry that file?????

i am using the chameleon theme.

infospill’s picture

does that theme have that feature? to add blocks?

mrbrowny’s picture

Implementing new regions in Marinelli theme.

See a solution here:
Blocks above (before) main Content. (Marinelli theme, but think it works for any theme)
http://drupal.org/node/292028

Claudio Gaston Abraham
(mrbrowny in Drupal)
Argentina
South America

Jeff Burnz’s picture

Yes it does, but its not a phptemplate theme so you have to do things a little different.

You have added your new region in chameleon.info - that is the same, so no problem there, lets call it "content top".

So in chameleon.info you have;

regions[content_top] = Content top

Now open up the file "chameleon.theme". This is the main theme file for chameleon, and where you need to make your next set of changes.

First you have to call the blocks - look for this (around line 26) and see how I have added the new block region:


  // Get blocks before so that they can alter the header (JavaScript, Stylesheets etc.)
  $blocks_left = theme_blocks('left');
  $blocks_right = theme_blocks('right');

  // Get the New block region - content_top
  $blocks_content_top = theme_blocks('content_top');

Step 3, nearly there! Now we need to print the region somewhere so we can output the blocks. You want this somewhere above the content but you don't specify where, so I'll assume its below the title.

Look around line 76 - you can see the main content td is opening and the breadcrumb and $title are right below it, so this must be the centre column.

We need to place this snippet below the $title (place this around line 80 or 81);


  if ($show_blocks && !empty($blocks_content_top)) {
    $output .= "<div id=\"content-top\">$blocks_content_top</div>\n";
  }

This will output a div with the ID of content-top, so you can style it.

I have never even looked at this theme until I read your question and I only tested for about 3 seconds so if I have done anything that will cause issues can someone point that out please, as far as I can see, this is just fine (and it works too).