How to use sidebar blocks in your theme?

tzomatz

Joined: 2013-05-27
Posts: 5
Posted: Sun, 2013-06-02 12:15

Hello

I was wondering if it is possible to use the sidebar blocks on other places in your theme? What I mean by this is: Is it possible to call a sidebar block from my html code?

For example <?= $theme->tag_cloud ?>

I tried copying the code from the tag core module. You know, the part where tags are foreached and printed, but that did not work when I pasted the code into page.html.php

Anyone know how to do this correctly?

Best regards,
Thomas Holden

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-06-02 17:13

All sidebar blocks can be moved around the page:
http://gallery.menalto.com/node/99949

So with the carousel module the carousel_recent block can be:
<?= carousel_block::get("carousel_recent", $theme) ?>
Random:
<?= carousel_block::get("carousel_random", $theme) ?>
Here is the list available blocks for the carousel module:

		"carousel_recent" 		=> t("Recent items carousel"),
		"carousel_popular" 		=> t("Popular items carousel"),
		"carousel_random" 		=> t("Random items carousel"),
		"carousel_random_album" => t("Random album carousel"),
		"carousel_recent_in" 	=> t("Recent items in album carousel"),
		"carousel_popular_in" 	=> t("Popular items in album carousel"));

Styling might be a issue so your on your own there.
With this Javascript type of block it is best not have more than one block of the same content on the page or they will conflict. You will have to use the sidebar appearance to move those blocks off the sidebar.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tzomatz

Joined: 2013-05-27
Posts: 5
Posted: Sun, 2013-06-02 17:40

Thank you for your fast replay :)

I will try this out.

Best regards,
Thomas Holden