Hi everyone,

I'm wondering... is there a way to add html code to have insert a block onto a page where you'd like?

What I mean is... I created a table on a page.. and in one of the rows of the table I want to have a block displayed there. Is it possible to do this? Can I add it by just adding html code or is it edited under page.tpl?

Thanks for the help!!!

Comments

vm’s picture

blocks get added to regions not to table cells.

you can create more regions in your theme or investigate modules like insert_block.module to see if it will help you solidify your idea.

mxer269’s picture

I guess what I mean is instead of using the site configuration/blocks method to position the blocks I want to insert the code into the tables so I can have the blocks show up in the correct table cell (& position). So I can control where its positioned.

TIA!

vm’s picture

I suppose if you wanted to hardcode something you can view the source of a rendered page, pick out what you want to hardcode copy it and paste it wherever you want. Though this won't allow what you've copied to be dynamic in nature, it will be static.

taking a look at block.tpl.php may prove fruitful to see if you can pull the dynamic bits out.

mileage will vary, I've only ever used regions

mxer269’s picture

ok.. cool. my example is I want to add a "recent forum posts" block into one of the rows on the table I've created. Do you mean the block itself will be static or the information also? I'm guessing you just mean the block.. so in other words I'd need to add the code to every page that has the table.

vm’s picture

recent forum posts block is dynamic, cutting and pasting it from a rendered page won't work at that point as you will expect the list to be updated and it won't be if hardcoded so that idea is out.

I"d create a new view for the recent forum posts block, and use the insert_view.module I think

mxer269’s picture

thanks for the help! I will do what you suggest.. but can you explain in more detail how I go about it?

mxer269’s picture

I actually just took another look at the genesis theme...and I think it will work well for what I want to do.

pitxels’s picture

http://drupal.org/project/insert_block

[block:name of module=delta of block]

...will insert the contents of a rendered sidebar block into the body of your node. If no delta is specified, the default block for that module will be displayed.

--
Drupal Theming at
www.pitxels.com