Welcome to Geeklog, Anonymous Saturday, October 01 2022 @ 02:05 am EDT

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 EDT. The time is now 02:05 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