Page 1 of 1

Theme and HTML Nugget per Category

Posted: Mon May 21, 2012 8:12 pm
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)

Re: Theme and HTML Nugget per Category

Posted: Mon May 21, 2012 9:10 pm
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

Re: Theme and HTML Nugget per Category

Posted: Mon May 21, 2012 10:27 pm
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?

Re: Theme and HTML Nugget per Category

Posted: Mon May 21, 2012 11:00 pm
by Don Chambers
Suggestion: Make sure properties/templates of categories plugin is the first plugin shown in event queue.

Re: Theme and HTML Nugget per Category

Posted: Mon May 21, 2012 11:51 pm
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

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 12:40 am
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.

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 8:39 am
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

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 2:10 pm
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?

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 2:33 pm
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

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 3:37 pm
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

Re: Theme and HTML Nugget per Category

Posted: Tue May 22, 2012 4:20 pm
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.