Theme and HTML Nugget per Category

Creating and modifying plugins.
Post Reply
rowi
Regular
Posts: 77
Joined: Fri Mar 16, 2007 9:10 pm
Location: Flensburg / Germany
Contact:

Theme and HTML Nugget per Category

Post by rowi »

I'd like my Android Category to be Green whilst the rest of the Blog appears blue.

I tried the serendipity_event_categorytemplates plugin but failed to modify (copy) the 2k11 Template I use to be able to place a different user.css in the directory and choose this copy as template for the Android category. However I end up with several double declarations if I just copy the template and rename the directory.

I'd also like to have a special HTML Nugget to appear just at the Android category. This is neither chooseable at the serendipity_html_nugget_plugin plugin nor in the serendipity_event_categorytemplates plugin.

Is there a way to achieve this?

(I'm not sure where this question belongs but I guess the solution is a plugin I missed)
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Theme and HTML Nugget per Category

Post by yellowled »

rowi wrote:I tried the serendipity_event_categorytemplates plugin but failed to modify (copy) the 2k11 Template I use to be able to place a different user.css in the directory and choose this copy as template for the Android category.
I already had a look at this in rowi's blog – seems like the categorytemplates plugin does not reference the user.css properly, it "keeps" /templates/2k11/user.css. The user.css is referenced in 2k11 using

Code: Select all

<link rel="stylesheet" href="{serendipity_getFile file="user.css"}">
so maybe the plugin doesn't work well with serendipity_getFile?

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Theme and HTML Nugget per Category

Post by Don Chambers »

is it loading BOTH user.css files - the "base" template copy of user.css plus the category specific copy?

FWIW, I too would love extending the options of HTML nuggets to only show on one or more specific categories.

@YL - unrelated to this, but how browser compatible is 2k11? We made sure bp was VERY browser compatible, back to at least IE6 I think... did you do the same with 2k11?
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Theme and HTML Nugget per Category

Post by Don Chambers »

Suggestion: Make sure properties/templates of categories plugin is the first plugin shown in event queue.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Theme and HTML Nugget per Category

Post by yellowled »

Don Chambers wrote:is it loading BOTH user.css files - the "base" template copy of user.css plus the category specific copy?
No, just the "original" user.css.
Don Chambers wrote:how browser compatible is 2k11? We made sure bp was VERY browser compatible, back to at least IE6 I think... did you do the same with 2k11?
Please, let's not hi-jack rowi's thread with this. I will post an answer to this in a new thread.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Theme and HTML Nugget per Category

Post by Don Chambers »

yellowled wrote:
Don Chambers wrote:is it loading BOTH user.css files - the "base" template copy of user.css plus the category specific copy?
No, just the "original" user.css.
L
I have tried duplicating this with just bulletproof, and s9y 1.6....

- I created a new folder bpcopy2
- I copied all bulletproof files to this new folder
- I modified info.txt in this new folder and changed the name to "Bulletproof Copy 2".
- I selected this copy as the template for a specific category, then saved the category.

When I try to configure this duplicate copy of BP for a specific category, I get a nearly blank page with only this content: <h3>Theme/Style options</h3>... so I was unable to select a user stylesheet for just that category.

Viewing the actual category page view, I can see that it IS loading this bpcopy2 style.css file, and is NOT loading the site-wide bulletproof user.css file.

However, this is not 2k11, and produced an unexpected error of not being able to configure the category-specific copy of the same template.
=Don=
rowi
Regular
Posts: 77
Joined: Fri Mar 16, 2007 9:10 pm
Location: Flensburg / Germany
Contact:

Re: Theme and HTML Nugget per Category

Post by rowi »

Currently it seems to me my copy of 2k11 doesn't integrates the user.css at all.
It works if I select it for the whole Blog (although the green looks very flat compared to the original blue tone) but if selected via serendipity_event_categorytemplates the user.css is not used.

Is the usage of user.css stored in the database and reset if I select a different template? I guess the easiest way would be to remove the check whether the user.css should be used. Since I have to edit the info.txt anyway when upgrading the template I guess it's the easiest way (for me).

Edit: I changed the defaults in config.inc.php for the used Webfont and user.css inclusion: http://rowi.standardleitweg.de/categories/31-Android
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Theme and HTML Nugget per Category

Post by Don Chambers »

When editing the category 'android', are you able to configure the copy of 2k11 you are using for that category, or do you get the same error I am getting with bulletproof?
=Don=
rowi
Regular
Posts: 77
Joined: Fri Mar 16, 2007 9:10 pm
Location: Flensburg / Germany
Contact:

Re: Theme and HTML Nugget per Category

Post by rowi »

I receive a double declaration error message:
Template-Optionen

Fatal error: Cannot redeclare serendipity_smarty_html5time() (previously declared in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/templates/2k11/config.inc.php:9) in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/templates/2k11-gruen/config.inc.php on line 9
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Theme and HTML Nugget per Category

Post by yellowled »

rowi wrote:(although the green looks very flat compared to the original blue tone)
That's because it is flat.

You're assigning one solid background color whereas 2k11's original color scheme uses a CSS3 gradient. (Yes, that's a feature still missing in the user.css generator. It's not easy to implement, especially because it requires an image to provide a fallback in browsers which don't support CSS3 gradients.)

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Theme and HTML Nugget per Category

Post by Don Chambers »

rowi wrote:I receive a double declaration error message:
Template-Optionen

Fatal error: Cannot redeclare serendipity_smarty_html5time() (previously declared in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/templates/2k11/config.inc.php:9) in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/templates/2k11-gruen/config.inc.php on line 9
I am not getting that error using two copies of a different template, each copy of which has functions defined in config.inc.php... only problem I have is not being able to use the template options for a category when that category's template is the same as the site template.
=Don=
Post Reply