42 pointsStarting to get into this DEV thingI'm new here
erealestatemu
Member
—
8th November 2009 04:10
Is there such a thing as a global sidebar? I'd like to take a regular WP widget and modify it to work on MU and have it show up in same place in the sidebar of every blog (they all use the same theme) but display blog specific information (using a get_option call). Do I just modify the sidebar.php file directly?
Is there such a thing as a global sidebar? I'd like to take a regular WP widget and modify it to work on MU and have it show up in same place in the sidebar of every blog (they all use the same theme) but display blog specific information (using a get_option call). Do I just modify the sidebar.php file directly?
I'm afraid such a feature doesn't exist (to my knowledge), Since you're using the same theme though, what you want to do is achievable. You have two options:
1) Hard code the sidebar content in sidebar.php like you mentioned.
2) Create a plugin that syncs the sidebar widget setting on all blogs to the widget setting on a master blog (any blog you want to use),
I'm trying to use the KB Advanced RSS widget on the sidebar to display a nice looking feed. However, since the widget uses get_option to get the RSS Url, each blog can have it's own source for the feed, which is what I'm looking for.
I see this in the theme:
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
How can I replace this with code to manually load my widget rather than relying on it being a registered widget stored in the 'sidebars_widgets' option within each blog? Is there an execute_widget('xyx') function?
I'm sure there's a function that triggers the widget display functions. Unfortunately I've never had to do so I don't know which function you'll need to use.
I would start with the dynamic_sidebar() function and trace the function calls back to the one that triggers the individual widget functions.
There may also be a less complex way of handling this that I'm not aware of.
Responses (5)
Erstwhile founder — 8th November 2009 04:48 #
Hiya,
I'm afraid such a feature doesn't exist (to my knowledge), Since you're using the same theme though, what you want to do is achievable. You have two options:
1) Hard code the sidebar content in sidebar.php like you mentioned.
2) Create a plugin that syncs the sidebar widget setting on all blogs to the widget setting on a master blog (any blog you want to use),
Thanks,
Andrew
Member — 8th November 2009 06:47 #
I'm trying to use the KB Advanced RSS widget on the sidebar to display a nice looking feed. However, since the widget uses get_option to get the RSS Url, each blog can have it's own source for the feed, which is what I'm looking for.
I see this in the theme:
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
How can I replace this with code to manually load my widget rather than relying on it being a registered widget stored in the 'sidebars_widgets' option within each blog? Is there an execute_widget('xyx') function?
Or is there a better way to accomplish my goal?
Erstwhile founder — 8th November 2009 07:28 #
Hiya,
I'm sure there's a function that triggers the widget display functions. Unfortunately I've never had to do so I don't know which function you'll need to use.
I would start with the dynamic_sidebar() function and trace the function calls back to the one that triggers the individual widget functions.
There may also be a less complex way of handling this that I'm not aware of.
Hope that helps.
Thanks,
Andrew
Member — 11th December 2009 18:20 #
Anybody figure out how to trigger a widget directly yet?
Keeper of the Dark Chocolate — 12th December 2009 13:30 #
Nope, been asked for many times on the mu forums.
Never looked into it myself.
Become a member