[SOLVED] How to use blocks from sidebar elsewhere on page

Retroguy
Retroguy's picture

Joined: 2010-12-29
Posts: 27
Posted: Wed, 2010-12-29 05:20

Hi all,

I've been playing with G3 for the last few days now and am pretty happy with it. However, I can't figure out how to move individual blocks out of the sidebar and onto other parts of the page.

Most specifically, I want to move the RSS feeds section up into the header area and the IPTC metadata onto the page below the photo.

If I use the following code

<?= $theme->sidebar_blocks() ?>

I get everything that is in the sidebar.

If I use this...
<?= $theme->tag_menu() ?>

I get a link to the slideshow.

How do I just target individual blocks of code? What are the hooks I need to use and where do I find them?

TIA and kind regards,

{edited to improve the subject heading.}

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2010-12-30 01:36

Right now there's no easy API call to do that because the framework is gathering up the sidebar blocks when you do $theme->sidebar_blocks(). However, if you know the module you want you can always request it's block directly. Sof ro the RSS feed, you can do:

<?= rss_block::get("rss_feeds", $theme) ?>

and you can get that block. Look in modules/*/helpers/*_block.php to get an idea of what blocks you can access that way.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
Retroguy
Retroguy's picture

Joined: 2010-12-29
Posts: 27
Posted: Thu, 2010-12-30 02:25

Many thanks Bharat,

Your RSS example worked perfectly and I've also managed to cobble together a snippet for IPTC.

Here is the code for anyone that is interested in displaying IPTC data elsewhere on the page.

<?= iptc_block::get("iptc", $theme) ?>

Thanks again and congratulations on a great gallery product.

regards,

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2010-12-30 07:51