Hi,

I've created a few blocks that I would like to manually insert into my front_page that I created with the Front Page.module.

For example, one of the blocks is called Latest_Articles and is a 'list' style Views block.

Another is called Latest_News and is a 'table' style Views block.

Would I need two different PHP snippets to insert these into my front page, or will the same one do?

Either way I'm unsure what this snippet would look like.

Any help would be much appreciated.

Thanks,

Alex

Comments

wisdom’s picture

Administer>>blocks>> and choose the specific place from the list. In your case content will place the blocks in the center of the page or content area. I do not think that you need to write a code.

ALT83’s picture

Hi,

Sorry I think I may not have been clear enough in my initial post. I am not looking to place blocks in the regularly available places in my theme, but I have designed a custom front page, using the Front_Page.module , which allows me to design the whole page in raw HTML (even the and tags).

For this custom front page, I want to manually place some modules (i.e. not in sidebars etc.)

If anyone can help with this code - particuarly for views.module blocks, that would be most appreciated.

Thanks,

Alex

bfdexp’s picture

I am in the same boat, any help on coding the PHP snippets would be great!!!

mitchepa’s picture

I have the same problem... Is there no way to do this?

ALT83’s picture

To display a block's content (not sure about block title) it is:

$block = module_invoke('views', 'block', 'view', 1); print $block['content'];

The number indicates the view number (which I just got based on trial and error)

Hope that helps.

Alex

ALT83’s picture

To display a block's content (not sure about block title) it is:

$block = module_invoke('views', 'block', 'view', 1); print $block['content'];

The number indicates the view number (which I just got based on trial and error)

Hope that helps.

Alex

norti’s picture

Thank you for that code. But how can I give an argument to this View ?

mariagwyn’s picture

I have a possible solution, but it does not use PHP code as I could not figure out the correct argument. What I did was create my view blocks, I inserted them into the 'content' area (in the blocks admin area), and then I configured each block (also in the block admin area) to only show up on a specific page, in my case, 'teaching' (no slashes, etc.). Now, when I go to my page: http://site.com/teaching, I see the created blocks. I assume that this will work for your front_page as well, you will simply need to set the configure to 'front' or whatever the name of your front page is.

If you discover a solution to the php argument, please let me know as I would be interested.

Maria

APriya’s picture

Hi,
I want to style the blocks created by views module.I know the default tpl file for block is block.tpl.php. I want to know that what would be the names of those files created using View module(as I want to style blocks created with the Views module) and what would be there content(in general).I am using Drupal6 and new to it.
Please help me in this regard.
Thanks in advance..