Is there a way to add a block?

Permalink Browser Info Environment
I know this is setup with a Content block, but was wondering if one could configure it to include another block, such as an AutoNav block. A nice addon as it is, but just curious.

Thanks.

Tim

Type: Discussion
Status: New
DBKG
View Replies: View Best Answer
jb1 replied on at Permalink Best Answer Reply
jb1
Hi Tim,
It's possible to create a custom block template (just copy the current view.php file into the "templates" folder at the same level and rename it). My suggestion would be to add a bit of PHP code (below line 29 in view.php) to pull in a block from the scrapbook with a particular name. This way you can still easily modify it. For example:

<?php 
   $block = Block::getByName('My_Site_Name');
   if( $block && $block->bID ) $block->display();  
?>


And just replace "My_Site_Name" with the name of the block from the scrapbook.

Hope this helps.

JB
DBKG replied on at Permalink Reply
DBKG
Thanks for your help. So far so good.

Tim
jb1 replied on at Permalink Reply
jb1
That's great to hear, well done :-)
koje73 replied on at Permalink Reply
koje73
Hi JB,
can you please describe a bit more in detail what to do and at which folders I have to do it.I´m try to ad a autonav using the accordeon menu to the static folder, does not work with your description.
Hope for help.

Thanks
Jens
jb1 replied on at Permalink Reply
jb1
The 'how to' area on the C5 website has more instructions on how to do this (http://www.concrete5.org/documentation/how-tos/).
But a quick starter is:
1) In the packages/jb_static_footer/blocks/jb_static_footer folder make a new subfolder called "templates"
2) Copy the view.php at that level into the "templates" folder and rename it to anything you wish (underscores are good, space characters are not) - eg. my_block_template.php
3) Make any changes you wish to this new file and upload it to the same location on your server.

When you edit this particular block, click on it and choose "custom template" you'll see a list of these custom block templates that are available.

Hope this helps. If you have any other queries, just open a new support request.

JB

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.