Hi,
Here a code for personal plugin that enable shown tags block in menu on all pages (except picture page) - on main page, categories, etc:
<?php /* Plugin Name: Show tags block on all pages Version: 1.0 Author: JanisV */ if (!defined('IN_ADMIN')) { add_event_handler('blockmanager_apply', 'update_block_tags'); } function update_block_tags($menu_ref_arr) { global $page; $menu = & $menu_ref_arr[0]; $block = $menu->get_block('mbTags'); if ( $block!=null and empty($page['items']) and 'picture' != script_basename() ) { $tags = add_level_to_tags( get_available_tags() ); foreach ($tags as $tag) { $block->data[] = array_merge( $tag, array( 'URL' => make_index_url( array( 'tags' => array($tag) ) ), ) ); } if ( !empty($block->data) ) { $block->template = 'menubar_tags.tpl'; } } } ?>
Piwigo version: 2.7
Offline
thx for sharing! :)
Offline
Version 1.1 with better processing subfolders:
<?php /* Plugin Name: Show tags block on all pages Version: 1.1 Author: JanisV */ if (!defined('IN_ADMIN')) { add_event_handler('blockmanager_apply', 'update_block_tags'); } function update_block_tags($menu_ref_arr) { global $page, $filter; $menu = & $menu_ref_arr[0]; $block = $menu->get_block('mbTags'); if ( $block!=null and empty($page['items']) and 'picture' != script_basename() ) { if (isset($page['category']['id'])) { if (!isset($filter['visible_categories'])) $filter['visible_categories'] = ''; $old_filter = $filter['visible_categories']; $filter['visible_categories'] = $filter['visible_categories'] . implode(',', get_subcat_ids(array($page['category']['id']))); } $tags = add_level_to_tags( get_available_tags() ); if (isset($page['category']['id'])) { if (empty($old_filter)) unset($filter['visible_categories']); else $filter['visible_categories'] = $old_filter; } foreach ($tags as $tag) { $block->data[] = array_merge( $tag, array( 'URL' => make_index_url( array( 'tags' => array($tag) ) ), ) ); } if ( !empty($block->data) ) { $block->template = 'menubar_tags.tpl'; } } } ?>
Offline
Hi there,
I think I understand exactly what this plugin does, but I can't quite figure out how to install it. What am I missing?
Thanks
hard to tell you since we don't know what you did
Offline
Fair enough :)
I tried following the tutorial here.
Since the code provided seems really meant for only one file, it didn't quite mesh up, but I've tried saving it as both index.php and main.inc.php within its own folder.
Use localfiles editor to create your personal plugin And don't forget to enable your plugin
Offline
Very useful. I remember just 3 days ago, I was cofused abot this question.
Offline