Skip to main content
Topic: If theme variant is so and so, do so and so (Read 3627 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

If theme variant is so and so, do so and so

I was trying not to change the index.template.php too much so that it will work for all variants. So I need to put some condition in its code.

I was wondering, how can we translate this into a proper EA code: if theme variant is so and so, do so and so. I try these two code but they are not working:

Code: [Select]
if ($settings['theme_variants'] == 'besocial')

and

Code: [Select]
if ($settings['theme_variants'] == 1)

Re: If theme variant is so and so, do so and so

Reply #1

I would say that if you have to change the template you are close not to have two variants, but two slightly different themes.
The idea of variants is to have two "aspects" perfectly identical in terms of markup but different in the css.

Out of curiosity what differences do you want to apply that require markup changes?
Bugs creator.
Features destroyer.
Template killer.

Re: If theme variant is so and so, do so and so

Reply #2

I can see that there is a setting that change css between light and besocial. I was hoping if I could understand that and use it in the index.template.php, I could allow some code being called or removed with this condition.

For instance, in my case, I am creating my own custom theme and putting the forum title, the quick login and the search box inline with the menu. This require modifications. So if I can use this condition (if it is somehow able to be used), I am able to disable/enable calling certain code in my light and besocial css.

By the way, there is another thing I wish to ponder. I  do believe that if a theme is just using css, we can just add a new css in its array. That would be simper rather than adding a new theme. But there is no way (yet) for us to create a simply new css theme. Can I suggest that this is made possible?

Re: If theme variant is so and so, do so and so

Reply #3

Quote from: ahrasis – For instance, in my case, I am creating my own custom theme and putting the forum title, the quick login and the search box inline with the menu.
Not tested but that should (in theory) be possible via position fixed / absolute / relative, depending on the current menu position.

This is a quick made sample for the forumtitle, moved to the left top corner ..
Code: [Select]
#forumtitle {
   font-size: 1em;
   position: fixed;
   top: 1px;
   z-index: 999;
   left: 5px;
}
Thorsten "TE" Eurich
------------------------

Re: If theme variant is so and so, do so and so

Reply #4

Yes. That can be done. But it won't be the same if it is inline with the menu. It's ok. I can make it a theme without variant anyway.

And if a custom theme is simply a css variant, IMO, the developer should consider this too. The idea is to give a choice between creating a totally new theme or simply to add a css variant to default theme.
Quote from: ahrasis – By the way, there is another thing I wish to ponder. I  do believe that if a theme is just using css, we can just add a new css in its array. That would be simper rather than adding a new theme. But there is no way (yet) for us to create a simply new css theme. Can I suggest that this is made possible?

Re: If theme variant is so and so, do so and so

Reply #5

I feel you are now talking about custom.css (and custom_putvariantnamehere.css)?
Like in http://www.elkarte.net/community/index.php?topic=1103.0
Bugs creator.
Features destroyer.
Template killer.

Re: If theme variant is so and so, do so and so

Reply #6

What I mean is, in the theme install page, currently you can simply copy a default theme to create your own. If there is no necessity to create theme, why not just allow user to copy a default css variant and rename it to his own css instead? That way, user will be encouraged to use css variant as much as possible rather than creating his own theme.

But if this will require a lot of works, just drop it. What can be done via custom theme creation, is so far ok.

Re: If theme variant is so and so, do so and so

Reply #7

Ohh... okay, now I got it.
In the current situation it may require few things, even only because variants are "hard-coded" into index.template.php, so it would require also to edit that file or load up the new variant somehow from... dunno, the database or something.
It may be possible, at the moment, I honestly don't know.
Bugs creator.
Features destroyer.
Template killer.

Re: If theme variant is so and so, do so and so

Reply #8

My idea is a variant installer/creator. Somethings similar to theme installer/creator. The different is, if variant is created/installed, it will be put in the default theme but under its own (variant) folder. It will also add the new variant as an option to forum admin only or to all users.

About adding forum title and search into, as well as login bar inside and inline with the menu, I guess maybe the best thing to do is using an addon instead, that is if the index.template.php is not to be directly modified.

Re: If theme variant is so and so, do so and so

Reply #9

Updated this topic just in case somebody is led to it. Now we have Create New Variant Easily addon to create a new variant, whether based on light or be social variant.

As for this topic's answer, basically we use custom_variant.css as replied by emanuele in Reply #5 above.


Re: If theme variant is so and so, do so and so

Reply #11

Nope.