blogs within blogs

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
mumsy72

blogs within blogs

Post by mumsy72 »

I am new to this. I do know that other blogs allow for multiple blogs within one blog. Can one do this with s9y?

Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: blogs within blogs

Post by garvinhicking »

Serendipity offers a plugin "serendipity_event_categorytemplates" that can be used in conjunction with Serendipity 0.9.

There you can turn categories of your blog into a "sub-blog" by assigning different templates and options for the category.

Together with the plugin serendipity_event_sidebarhider you can only show certain sidebars depending on the category.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

THAT's what I need!

Post by judebert »

I'm missing the serendipity_event_sidebarhider plugin. I'm running 0.9-beta2 with SPARTACUS installed. Maybe I'm just not finding its descriptive name or something.

I'm also considering a new sidebar plugin to provide the rest of my desired functionality. Here's the idea:

Assign some of the categories as sub-blogs, or "sections".
Only show categories in the current subtree.
Add another sidebar plugin to show all the sections (or better yet, make it a top tab!).

I've got plugins installed already to do the subtree hiding. I know I can give each category its own template, but I'd really like to keep the ability to switch skins, so I need to implement it as plugins.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: THAT's what I need!

Post by garvinhicking »

The sidebarhider plugin is called "Toggle sidebar state" :-))
Assign some of the categories as sub-blogs, or "sections".
That can be done with the categorytemplates plugin
Only show categories in the current subtree.
The categories plugin of 0.9 supports this.
Add another sidebar plugin to show all the sections (or better yet, make it a top tab!).
You can install the categories plugin with different options multiple times. :) Top tab functionality needs to be implemented in your own template; you can use advanced plugin API methods to show a special plugin (category plugin) somewhere else. Read http://www.s9y.org/78.html for more info.
I've got plugins installed already to do the subtree hiding. I know I can give each category its own template, but I'd really like to keep the ability to switch skins, so I need to implement it as plugins.
You can still switch skins in categories that have a different template assigned; at least that's what it should do. You might need to push the template selector event plugin below the categorytemplates plugin in your plugin config queue stack.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

90% there

Post by judebert »

Maybe I'm just getting skins and templates mixed up or something. I've got the "Toggle Sidebar State" plugin installed. Given some more time to mess with it, I'll figure out how to hide a particular sidebar when I'm in a particular category, I'm sure. (That is what it does, right?)

Right now, I'm trying to hide all those extra categories; I just want to display the important branch categories. I multi-select the ones I want, click on "Save changes to layout", and get this error:

Warning: Invalid argument supplied for foreach() in /www/j/judebert/htdocs/wasted_youth/plugins/serendipity_event_sidebarhider/serendipity_event_sidebarhider.php on line 405
The new settings have been saved at 16:41:03

And all the categories are still showing on my frontpage.

I'll do more debugging when I get home. I think I must be using the Toggle Sidebar plugin incorrectly; its layout is... improvable, I think.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Okay, that was an easy one. If you don't have any left-side (or right-side) sidebar plugins, it'll display an error. Avoiding it is as simple as wrapping the foreach statements on lines 405 and 415 in if (is_array($plugins_left)) {}. Of course, you use $plugins_right on 415.

I do believe we need two extra features: there's no obvious way to reset the "Members Only" or "Myself Only" to the default ("Everybody", I guess). We need an additional radio button for that. We may want to consider restricting it to user groups, too.

Also, I recommend adding a pseudo-category "Front Page" to the list of categories. We could use "No Specified Category" or something. The point is to allow the admin to display something different on the default page of the blog.

I'm going to start work on those later tonight. We'll see who gets there first. :wink:
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Ding-ding!

Post by judebert »

Okay, the modified serendipity_event_sidebarhider plugin that I'm using on my (non-live) site right now recognizes the front page of your blog as if it were a category. It also includes an "anybody" permission button, making it easy to recover from mistakenly entering a user restriction. Finally, its logic allows you to specify *both* a user restriction and a category restriction; for example, "Only show the calendar to members who are browsing the "Schedule" category." :D

Garvin, I figured you didn't want me to post 400+ lines of code here, so I'm making a tarball (link removed) available, at least until you decide if you want to add it to the repository or not.

If I get any more free time, I'd like to separate this plugin into a sidebar hider and a sidebar collapser. I'm not fond of Javascript, and I don't need the collapsing functionality. Garvin? :?:
Last edited by judebert on Wed Oct 19, 2005 3:49 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Ding-ding!

Post by garvinhicking »

Hi judebert!

Perfect patch, I just committed it! Thanks a lot!

As to the javascript thing: I would prefer if you just add a config switch toggle so that people can choose to collapse sidebars or not?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Collapse script switch

Post by judebert »

As to the javascript thing: I would prefer if you just add a config switch toggle so that people can choose to collapse sidebars or not?
Finished! (You've already done that. :lol:)

I'll take the engineer's perspective on this: it ain't broke, so I won't fix it. I've got other interesting things to do with that plugin, and after all... it's your program. I respect your decision on the tradeoff between composable components and the number of plugins littering the SPARTACUS directories.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Collapse script switch

Post by garvinhicking »

D'oh then :))

You are exactly right: Littering the spartacus repository is a main concern of mine, so I try to enhance existing plugins instead of creating many little ones...

REgards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply