Theme Colors - Change on a board level

Started by hawk11220, September 12, 2015, 06:42:25 PM

Previous topic - Next topic

hawk11220

Hello,

I am using the Redsy Theme, which I really like, and I also really like Exodus Theme, which is installed.

I currently have about 30-35 primary private boards, and each with private child boards.  I would like to set each board to its own theme using either the Redsy or Exodus Theme as a default, is this possible on a board level?  I am only looking to change colors on a board level, and maybe some images.

Thanks in advance.

Antechinus

It's possible, but it's a lot of work with that many boards. Generally, you'd have to make and install a new theme for each board.

You could use custom code up in template_init, combined with a lot of css changes, to run it all from one theme. That trick would save you having to make separate themes per se, but you'd still be up for a lot of css work.

br360

You can also just go into Admin>>Boards>>Modify Boards...Then click the modify link of the board you want a different theme you installed, find Board Theme:, and change the theme for that one board.

Antechinus

Yeah but that involves installing a different theme for each board first. This guy is talking about 50 or so boards, AFAICT.

I have to wonder why this is necessary anyway.

hawk11220

Quote from: Antechinus on September 12, 2015, 06:53:00 PM
Yeah but that involves installing a different theme for each board first. This guy is talking about 50 or so boards, AFAICT.

I have to wonder why this is necessary anyway.

It's not necessary, it is just something I would like to do.  I have 30-35 different membergroups, and I would like to set those membergroups boards up distinctly. 

I would like to use the same theme, Redsy or Exodus for each board.  Since Redsy is Red, maybe blue for one private board, yellow for another, green for another, etc. 

Quote from: br360 on September 12, 2015, 06:52:11 PM
You can also just go into Admin>>Boards>>Modify Boards...Then click the modify link of the board you want a different theme you installed, find Board Theme:, and change the theme for that one board.

Sorry, I wasn't clear, I mean the same theme but change color on a board level. 

aegersz

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

hawk11220

Quote from: Antechinus on September 12, 2015, 06:49:13 PM
It's possible, but it's a lot of work with that many boards. Generally, you'd have to make and install a new theme for each board.

You could use custom code up in template_init, combined with a lot of css changes, to run it all from one theme. That trick would save you having to make separate themes per se, but you'd still be up for a lot of css work.

I kinda figured that is what I would have to do.  Would you know, off hand, how I can install the same theme several times but with a different name?

hawk11220

Quote from: aegersz on September 12, 2015, 07:02:46 PM
i use a the default theme and change colors with this mod: http://custom.simplemachines.org/mods/index.php?mod=3023

just a thought.

I'll check it out, I was looking for a mod, but couldn't find one.  Thanks.

Antechinus

Quote from: aegersz on September 12, 2015, 07:02:46 PM
i use a the default theme and change colors with this mod: http://custom.simplemachines.org/mods/index.php?mod=3023

just a thought.

That just changes colours on the board index. The OP wants to have a different theme within each board. ;)


Quote from: hawk11220 on September 12, 2015, 07:03:28 PM
Quote from: Antechinus on September 12, 2015, 06:49:13 PM
It's possible, but it's a lot of work with that many boards. Generally, you'd have to make and install a new theme for each board.

I kinda figured that is what I would have to do.  Would you know, off hand, how I can install the same theme several times but with a different name?

Yeah sure, you can do that. It'd involve changing the name in a couple of files and renaming the zip, but you can do that if you like.

Or, you can use the other trick I mentioned to run it all off one theme. That way you're only up for the css edits. I suspect nobody will remember what all the colours mean, given that you will have so many of them, but it's up to you. :)

I'll go grab one of those themes and edit index.template.php to suit the all-off-one-theme trick. BRB.

br360

Quote from: hawk11220 on September 12, 2015, 07:03:28 PM
I kinda figured that is what I would have to do.  Would you know, off hand, how I can install the same theme several times but with a different name?

You can install the same theme multiple times and then just rename each new install of that theme in its settings. Not sure how it would affect the board having say 30-35 themes installed though.

Antechinus

You can try these. There's one file for Redsy and one for Exodus.

What these will do is set a body tag id according to the board you are in.  You can then use that for CSS targetting on a per-board basis.

So if you were inside board_35 the body tag would look like this:

<body id="board_35">

And you could use that to change the colour of header links by using:

#board_35 header a
{
display: block;
color: #999;
}


instead of the default

header a
{
display: block;
color: #444;
}

hawk11220

@Ant Cool Thanks. 

@br360  I was concerned about having to many themes installed as well.  However, until I know how to proceed, do you know where I change the name.  I tried, and I lost all css.  Thanks.

Antechinus

You can basically install as many themes as you like, unless you're going up into the hundreds. Won't matter much for a few dozen, if you want to do it that way.

The files to edit are theme_info.xml and languages/Settings.english.php

The first one is the most important. Examples here:

<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<id>antechinus:apocalypse_tk2</id>
<version>2.0.9</version>
<!-- Theme name, used purely for aesthetics. -->
<name>Apocalypse TK2</name>
<!-- Author: your email address or contact information.  The name attribute is optional. -->
<author name="Antechinus">http://www.simplemachines.org/community/index.php?topic=524324.0</author>
<!-- Website... where to get updates and more information. -->
<website>http://www.simplemachines.org/</website>
<!-- Template layers to use, defaults to "main". -->
<layers>html,body</layers>
<!-- Templates to load on startup.  Default is "index". -->
<templates>index</templates>
<!-- Base this theme off another?  Default is blank, or no.  It could be "default". -->
<based-on></based-on>
</theme-info>


<?php
// Version: 2.0; Settings

global $settings;

$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = '<span class="double_height largetext">Apocalypse TK2:</span>
<br />
Author: Antechinus

Antechinus

Quote from: hawk11220 on September 12, 2015, 07:40:27 PM@br360  I was concerned about having to many themes installed as well.  However, until I know how to proceed, do you know where I change the name.  I tried, and I lost all css.

Don't try and edit names on themes that are already installed. Change the name first, then rezip the theme, then install it.

hawk11220

Quote from: Antechinus on September 12, 2015, 07:46:12 PM
Quote from: hawk11220 on September 12, 2015, 07:40:27 PM@br360  I was concerned about having to many themes installed as well.  However, until I know how to proceed, do you know where I change the name.  I tried, and I lost all css.

Don't try and edit names on themes that are already installed. Change the name first, then rezip the theme, then install it.

I didn't change it on the installed themes, but the new one I am trying to use. 

The first time I tried this, changed the folder name to New Theme, zipped it, and installed it.  I switch my forum to the New Theme, and I lost all css. 


<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>Daniiel:redsy</id>
<version>2.0.9</version>
<!-- Theme name, used purely for aesthetics. -->
<name>New Theme</name>
<!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Simple Machines">[email protected]</author>
<!-- Website... where to get updates and more information. -->
<website>http://www.smftricks.com</website>
<!-- Template layers to use, defaults to "html,body". -->
<layers>html,body</layers>
<!-- Templates to load on startup. Default is "index". -->
<templates>index</templates>
<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on></based-on>
</theme-info>


I then tried to fill in the <based-on> as Redsy, and I changed the ID.  (I also tried without changing the ID). 


<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>Daniiel:redsy-newTheme</id>
<version>2.0.9</version>
<!-- Theme name, used purely for aesthetics. -->
<name>New Theme</name>
<!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Simple Machines">[email protected]</author>
<!-- Website... where to get updates and more information. -->
<website>http://www.smftricks.com</website>
<!-- Template layers to use, defaults to "html,body". -->
<layers>html,body</layers>
<!-- Templates to load on startup. Default is "index". -->
<templates>index</templates>
<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on>Redsy</based-on>
</theme-info>


I am trying this first, because I may want to change logo's and images to each board.  However, I am still only getting the site with no css.

I don't know what to change the Settings.english.php file so I just did this...

// Version: 2.0; Settings


global $settings;


$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = 'NewTheme <br /><br />Author: Daniiel';
?>

Antechinus

Hang on. When you say "changed the folder name, zipped it" do you mean

1/ Opened the folder, selected all files and sub-folders, and zipped those.

2/ Just zipped the whole folder?

2/ won't work. You need 1/.

hawk11220

I unzipped redsy.zip [nofollow] changed the files, saved them.  changed the redsy folder to newTheme, and zipped newTheme.zip.  All the files and sub-folders are inside newTheme.zip [nofollow], but the files and sub-folders themselves are not zipped.   

Antechinus

Ok, what I mean is if you look inside the zip, is the newTheme folder the first thing you see, or are the SMF files and folders the first things you see?

It has to be the second way: SMF files and folders directly inside the zip. If they are one level down inside another folder, it won't work.

hawk11220

Quote from: Antechinus on September 12, 2015, 11:30:43 PM
Ok, what I mean is if you look inside the zip, is the newTheme folder the first thing you see, or are the SMF files and folders the first things you see?

It has to be the second way: SMF files and folders directly inside the zip. If they are one level down inside another folder, it won't work.

Edit:  I was wrong, you were right.  Sorry.  Working now.  Thank you for all your help.

hawk11220

Quote from: Antechinus on September 12, 2015, 06:53:00 PM
Yeah but that involves installing a different theme for each board first. This guy is talking about 50 or so boards, AFAICT.

I have to wonder why this is necessary anyway.

I wanted to thank you again for helping me with this issue, and although it has taken far longer to complete than anticipated, I wanted to show why I wanted to do this.

http://footballlunatics.com/ [nofollow]

Even though it did take a while to complete it was more time restraints than difficulty. 

DanielSan34

Quote from: Antechinus on September 12, 2015, 07:35:35 PM
What these will do is set a body tag id according to the board you are in.  You can then use that for CSS targetting on a per-board basis.
hello,

i'm looking for the same result but with this issu
instead of
$context['current_board']
this is possible to generate the id of the parent-forum (or category) ?

looking the linktree array in $context, i would like to use #c45
[linktree] => Array
        (
            [0] => Array
                (
                    [url] => http://localhost/forum/index.php?action=forum
                    [name] => general name
                )

            [1] => Array
                (
                    [url] => http://localhost/forum/index.php?action=forum#c45
                    [name] => forum/category name
                )

            [2] => Array
                (
                    [url] => http://localhost/forum/index.php?board=173.0
                    [name] => topic name

        )


searching in /sources/load.php :

// Build up the linktree.
$context['linktree'] = array_merge(
$context['linktree'],
array(array(
'url' => $scripturl . '#c' . $board_info['cat']['id'],
'name' => $board_info['cat']['name']
)),
array_reverse($board_info['parent_boards']),
array(array(
'url' => $scripturl . '?board=' . $board . '.0',
'name' => $board_info['name']
))
);

it's $board_info['cat']['id'] that i would use for my id body in board and topic theme.

How can i do this ?

thanks you

ps : i'hope my "english" would understanding ;D

Advertisement: