different styles for each category

For support and discussion related to templates, themes, and imagesets in phpBB 3.1.
Suggested Hosts
Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

different styles for each category

Post by Gobbetto »

hello, I would like to know if i can use a different style each category

to explain better I put a sample image

Image

in pca, changing the green wheel, in theory you can choose a style in each category, but in this way the different style is seen opening that category, not in the index of the forum

I can somehow get a result similar to that of the image?

thank you

bye

User avatar
pit-PL
Registered User
Posts: 3090
Joined: Sat Nov 21, 2009 12:24 pm

Re: different styles for each category

Post by pit-PL »

In forumlist_body.html replace <div class="forabg">
with <div class="forabg cat-{forumrow.FORUM_ID}">.
In colours.css before .panel { add

Code: Select all

.cat-xx {
	background: green;
}
Hover the mouse over each category and you'll see the php?f=xx where xx is the forum ID.

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

thanks for reply,

i don't have a line just

Code: Select all

<div class="forabg">
i find

Code: Select all

<div class="forabg category-{forumrow.FORUM_ID}{% if definition.STANDARD_FORUMS_LAYOUT == 0 %} elegant{% endif %}" data-hide-description="{$HIDE_FORUM_DESCRIPTION}">
about "colours.css" i don't have it on my style, i must change the prosilver file ?

thanks again

User avatar
Lumpy Burgertushie
Registered User
Posts: 67243
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: different styles for each category

Post by Lumpy Burgertushie »

what is the name of your style?

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?

User avatar
Ibedejo
Registered User
Posts: 243
Joined: Tue Feb 21, 2012 12:12 am

Re: different styles for each category

Post by Ibedejo »

Must be one of Arty's styles ;)

In this case you should try:

1) You dont't need to edit forumlist_body.html - keep it the way it is.

2) open /styles/*stylename*/theme/_custom.scss
add in a new line at the end of the file

Code: Select all

.category-xx {
    background-color: #FF0000;
}
(Change xx to the category ID you want to colorize and adjust the value for background-color)
Repeat this step for each category you want to adjust the colour of.

3) re-compile stylesheet.scss
=> you should read this article first since you need either a dedicated compiler or to install Arty's SASS Compiler Extension for this job.

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

thanks for reply,

i download Sass compiler for phpBB, and installed

after install, on my style, i see this written: File SCSS updated recently, the recompilation may be necessary.

the style is Black_Red, but I have modified it from

Image

to

Image

when I modified the style had changed the code of file stylesheet



if i do the recompilation, without any more change on style code, the forum look like this:

Image

so, just with recompilation from Sass compiler for phpBB i "lost" my style


about your code, by entering the code the background color changes like this:

Image

is possible also change the color in the image is light gray ?

thanks a lot

bye

User avatar
Ibedejo
Registered User
Posts: 243
Joined: Tue Feb 21, 2012 12:12 am

Re: different styles for each category

Post by Ibedejo »

A few remarks beforehand ... ;)

In Arty's styles you never edit stylesheet.css because this file contains the output of the compiling process which will then be the only CSS-file loaded. As you had to notice each time you have to re-compile this file will be rebuilt from scratch, eliminating all your edits to it.

To customize the CSS you either edit the code in the corresponding scss files (such as _colours.scss etc.) or you cosolidate your edits in one of the two "custom" files provided for this task:
- _custom_config.scss => instead of editing code in _style_config.scss copy those lines you want to change/adjust into this file and do your edits there.
For all other edits:
- _custom.scss => instead of editing individual scss files you can add your edits to this file and so leave the original files untouched. (See my last post ;) )



Back to your post:

1) Style name:
There is no "Black_Red" colour variant of the Black style at artodia.com I could localize - did you use ColorizeIT to create it?

2) "Lost Edits":
In case you remember your edits to stylesheet.css (or happen to have some kind of a documentation of your changes) you could try to re-apply your edits, but this time to one of the both files I mentioned above.

3) Background colour:
My mistake - copied over the code for something completely different I tested in parallel (getting old or so ...) ... :oops:
So delete the code I posted above and add this to _custom.scss instead:

Code: Select all

.category-xx.forabg ul.topiclist li.row, .category-xx.forumbg ul.topiclist li.row {
    background-color: #FF0000;
}
Again change "xx" to the ID of the corresponding categora and "FF0000" to your colour value.
Repeat for each category you want to colorize and re-compile.

Example in one of my test boards:

Code: Select all

.category-1.forabg ul.topiclist li.row {
    background-color: #FF0000;
}

.category-3.forabg ul.topiclist li.row {
    background-color: #FFAA00;
}
results in:
catcolours_01.png
4) "change the color in the image is light gray":
Could you add another screenshot with some kind of a pointer/marker indicating which part you want to adjust?
If possible: a link to your board would be be helpful.

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

for first thanks again for reply and help

about the colors now is perfect, but just on index page, if i open a category or a single forum the style come back to normal, the new color there is not

about my style, yes probably is not black_red, ad yes i used ColorizeIT

the problem is that after ColorizeIT I modified manually stylesheet.css (it was recommended in the Italian support forum)
and this take to me a long long time because I'm not a code expert, and I did test after test by analyzing each time the page with browser to understand where is the code to modify

I do not have documentation of the changes I made unfortunately :cry: :roll:

the link of my forum is this: http://italianracersmsm.altervista.org/forum/index.php

What can I do to not have to redo all the customizations?

thanks a lot

bye

p.s. i add my stylesheet file
Attachments
stylesheet.rar
(20.62 KiB) Downloaded 28 times

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

definitely it will not be correct, but also works by putting your code directly in the file stylesheet

probably the code this way is not "clean" and there will be some strange duplicate

but it works

it is such a bad solution?

User avatar
Ibedejo
Registered User
Posts: 243
Joined: Tue Feb 21, 2012 12:12 am

Re: different styles for each category

Post by Ibedejo »

I'll have a look at this file over the weekend (hopefully) - in case you did all your edits there and not in one of the "regular" scss files there should be a way to recontruct it, though it might be a little time consuming.
Gobbetto wrote:definitely it will not be correct, but also works by putting your code directly in the file stylesheet
It does work - but only until you have to re-compile the stylesheet. Something that can be avoided for quite some time, true, but some adjustments or situations won't leave you an alternative.
And then you will be facing the same problem you have right now: your edits will be gone and you'll have to re-apply them.

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

ok, thank you for your efforts

i will wait your notice :D

bye

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

sorry but the real stylesheet of my on line forum is this
Attachments
stylesheet.rar
(20.87 KiB) Downloaded 33 times

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51085
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: different styles for each category

Post by stevemaury »

None of the the above is necessary. You can assign a different style to each category (or the forums within it) in the ACP, Forum settings.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

as I wrote in the first message I tried to use that method but it does not work

if i change style of category, the style change just if you open the category, not on index page

thanks

bye

Gobbetto
Registered User
Posts: 48
Joined: Wed Oct 26, 2016 7:15 pm

Re: different styles for each category

Post by Gobbetto »

however, if for change the style should not change the file stylesheet, why all styles that are downloaded have just edited that file ?

I'm wrong?

Locked

Return to “[3.1.x] Styles Support & Discussion”