About smf default theme?

Started by HendriXXX, January 16, 2020, 02:01:40 PM

Previous topic - Next topic

HendriXXX

Hi!

My forum users wants somekind of dark theme a side of default Curve2 light theme. I played a bit with Curve2 Color Changer in my test installation and it worked nicely. Now I have nice dark theme.

Question is, how can I now keep both themes, light and dark? And because they want both, it should be user changeable. I tried to look in the code, what that mod does, but I didn't really understand it at all.

I was thinking, maybe it is possible to make a copy of that default Curve2 light theme and use that as light theme..

Can you help me?

Thanks in advance!  :)

Sir Osis of Liver

Hmm, you can copy Curve2 from /Themes/default/ into a second theme directory /Themes/curve2dk/.  Then you'll need to create a theme_info.xml file like this with your theme info -



<?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>antes:lunarfall</id>
<!-- The theme's version, please try to use semantic versioning. -->
<version>0.6.0</version>
<!-- Install for, the SMF versions this theme was designed for. Uses the same wildcards used in the packager manager. This field is mandatory. -->
<install for="2.1 - 2.1.99, 2.1 Beta *, 2.1 RC *" />
<!-- Theme name, used purely for aesthetics. -->
<name>Lunarfall</name>
<!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Antes">[email protected]</author>
<!-- Website... where to get updates and more information. -->
<website>http://www.simplemachines.org/</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>



Place the file in the new theme directory, install the theme "From a directory on the server", install color changer mod in both themes, set default them light, new theme dark.  Members can select theme in profile if you "Allow members to select their own themes" in "Themes and Layout settings".

Haven't tried it, but think that's right.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Bob Perry of Web Presence Consulting

I agree should work, but you'll need to reinstall all the mods not just the one I believe?
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

HendriXXX

Ok. Thanks for your response!  :)

I will test that today in my test installation. Let's see what happens..  ;D

I have no other mods yet, only that color changer.

gecitli

http://www.webtiryaki.com
webmaster forumu
Free & Premium Responsive Themes for SMF.

HendriXXX

Well, little update. I finally managed to get it work. It is setup like default is dark theme and new curve2light is light theme.
I had problems to get "color changer" installed to other theme also. I tried to copy files from command line, and also from admin menu but no luck. So that mod is now only installed to default theme which is the dark one.

Now i have strange problem, my admin account can see theme thumbnails from user menu "look and layout", but normal members cannot see those. I cannot understand what i am missing. It aint big problem but I think is would be nicer if user can see like what theme look like.

Even stranger is that this works fine in my test installation. There users can see theme thumbnails just fine.

Do you have any ideas?

Thanks!  :)

HendriXXX

Another issue noticed. When I install color changer mod to our forum real server, it breaks login.
When I or anybody else log in, only some basic html is showed top left corner.
And it seems to be only top bar (user,my messages,alerts). When i press some of those it starts to render page right.

I am starting to think that there is something seriously wrong with my main install, because test install works fine with those modifications.

I had to revert changes back and keep testing or I leave dark theme for now. We are going to move to a new server at some point and I hope that 2.1 rc3 is released by then and I can start building forum from scratch. It there any possibility to break something like doing that when going from rc2 to rc3?

And one other thing, How can I upgrade rc2 to master devel version? Of course I will do that in my test environment, not on production server..  :)

Illori

at this time due to a bug I don't recommend upgrading to the version on GitHub. once it is fixed you can upgrade. our dev team is working on the fix.

if you are having trouble with a mod please post in the mods support topic so the author can assist you further. also posting the raw html that is showing could help to troubleshoot the issue.

HendriXXX

What upgrade bug are you referring?

If I can get that issue repeated with my test install, I will try to gather more info for devs.
Strange is that issue happened only on my production forum, but not in test forum. i had to revert changes back fast so I didn't really have time to get screenshots or anything.

Yesterday I noticed that there are few differences between servers. My production server is based on 16.04 Ubuntu (yes that is old, but no time to upgrade it newer), so libraries are different versions than in my test server, which have 18.04 Ubuntu.
Maybe that is the issue. When we get new server, I will install 20.04 Ubuntu to it, so it is going to be supported for long time then. Maybe it will work then better.  :)

Antechinus

Quote from: gecitli on January 17, 2020, 12:59:42 AMHi can you do this with js css

http://www.onlinetutorialsweb.com/day-night-mode-switch-toggle-2-html-css-javascript/


See Demo

Just checked out the demo. Like most of these CSS/JS combination tricks it works, mostly, but is prone to bad FOUC at times. This is due to rendering starting before the js gets applied, so you see the default briefly.

Quite honestly: it is better to do this sort of thing with SMF's built-in variant system, because that determines the page content before sending it to the browser, so there is never any FOUC.

Doing it with javascript is, in my opinion, only a "next best" option for applications which don't support a server-side solution out of the box.

Advertisement: