Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 12:25 am EST

Geeklog Forums

Display any content in right-hand blocks


Status: offline

James Fryer

Forum User
Junior
Registered: 08/06/02
Posts: 17
I needed to display a different set of blocks in the right-hand column of one page. To do this I hacked the function COM_siteFooter.

This takes a Boolean parameter $rightblock which indicates whether or not to display the blocks.

I changed this to also support a string, so you can call COM_siteFooter($block_data) and it will display $block_data in place of the usual right hand blocks.

Here's the changes to COM_siteFooter (for v1.3.9 but I doubt if later versions differ much). At about line 1131, change the code after 'if ($rightblock)' as follows:

Text Formatted Code

   if( $rightblock )
    {
      if (is_string($rightblock))
        $rblocks = $rightblock;
      else
        $rblocks = COM_showBlocks( 'right', $topic );
    }
   if( $rightblock && !empty( $rblocks ))
   ...

 


Ideally the $rightblock string should be formatted into blocks, but if your theme allows it you can put any text in there.

One place I see this being useful is the 'related items' panels on story pages, which at the moment don't always behave themselves.
 Quote

All times are EST. The time is now 12:25 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content