Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Saturday, May 18 2013 @ 09:10 AM EDT

> >

Left & Right Block Formatting in 1.5.1

Geeklog
  • Thursday, September 11 2008 @ 03:41 PM EDT
  • Contributed by:
  • Views:
    5,166

Geeklog Themes support the ability to define a different template for different blocks. So your "What's New" block can render differently to your Login block etc. This is done by populating an array called

$_BLOCK_TEMPLATE
in a theme's functions.php file. This array is populated with the identifiers for blocks and can set specific block header and footer templates used to format specific blocks to give them a unique look and feel.

The Professional theme that ships with Geeklog prior to 1.5.1 provides logic within functions.php to alter the template for blocks without a specific template assigned to be the left or right block template depending on which side the block has been placed by the site administrator. This changes with Geeklog 1.5.1

In 1.5.1, Geeklog still uses the same method to allow custom templates for block header and footers, however, once it has determined from the

$_BLOCK_TEMPLATE
array which template to use, it checks to see whether there is an override to that template for the side the block is on.

For example, if the

$_BLOCK_TEMPLATE
value for the admin_block contains blockheader-list.thtml and blockfooter-list.thtml Geeklog will check for blockfooter-list-left.thtml and blockheader-list-left.thtml if the admin_block is on the left. If those files do not exist, Geeklog will stick with blockheader-list.thtml.

Geeklog is also intelligent enough that if your theme has already mapped admin_block to a template that ends in a side (i.e. blockheader-list-left.thtml then it will not perform this action.

So, it is now much easier for theme developers and site administrators to style their left and right blocks differently even if those blocks are using custom rendering templates. There is however something to note when upgrading a site to Geeklog 1.5.1. Some plugins, such as the Geeklog Forum plugin use CUSTOM_showBlocks, and this function has changed in 1.5.1, so, when upgrading your site, make sure to copy across CUSTOM_showBlocks from the lib-custom.php.dist file to your own lib-custom.php file. Unless of course you have modified CUSTOM_showBlocks, in which case you'll need to review and understand the changes in our new function to review them for your site, or you may have some formatting issues with your blocks when running plugins such as the Geeklog Forum Plugin.

Trackback

Trackback URL for this entry:
http://www.geeklog.net/trackback.php/left-and-right-block-formatting-in-151

The following comments are owned by whomever posted them. This site is not responsible for what they say.

Post a Comment

Your Name
Create Account
Allowed HTML Tags:
 

Security code
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

What code is in the image?
Enter the bolded text, case sensitive!
Important Stuff
  • Please try to keep posts on topic.
  • Try to reply to other people comments instead of starting new threads.
  • Read other people's messages before posting your own to avoid simply duplicating what has already been said.
  • Use a clear subject that describes what your message is about.
  • Your email address will NOT be made public.