ElkArte Community

Elk Development => Theme development => Topic started by: Jorin on February 25, 2015, 10:44:53 am

Title: Needed files for custom themes
Post by: Jorin on February 25, 2015, 10:44:53 am
As you maybe know I use a modified default theme (light variant) with some CSS changes and some changed graphics. I tried to keep my themes as small as possible so I tried to delete all unneccessary folders and files. Elk should use the default theme files instead.

But there are some problems. CSS is cool, but if I delete the images folder of my theme, a lot of images are not shown. For example the small images before the titles in the info center or the standard avatar.

Is there a way you can fix this in a future update so all I need to keep in my theme folder are my changed files?
Title: Re: Needed files for custom themes
Post by: emanuele on February 25, 2015, 10:55:34 am
That may (or may not) be what a variant is.
Did you change any php file of your theme?
Title: Re: Needed files for custom themes
Post by: Jorin on February 25, 2015, 11:08:17 am
I made a copy of the default theme (so my users can choose between them) and then made a custom css file for it. I thought I could delete all not needed files and Elk uses the default file then, including images?

I will edit a template file so the recent topics move out from the info center to the top of my board, yes. Not yet made, but will be soon (I hope).
Title: Re: Needed files for custom themes
Post by: emanuele on February 25, 2015, 12:34:58 pm
hmm... it should actually be possible (it's an option I always forget), but you need to keep index.template.php and add:
Code: [Select]
'use_default_images' => 'always',
at the first function, let's say before or after:
Code: [Select]
		'avatars_on_indexes' => true,

Quote from: Jorin – I will edit a template file so the recent topics move out from the info center to the top of my board, yes. Not yet made, but will be soon (I hope).
/me waits for the questions. :P
Yep, it's not just a copy&paste of the lines of code. ;)
Title: Re: Needed files for custom themes
Post by: Jorin on February 25, 2015, 01:13:12 pm
You offer support. Not my fault.  :P

I'll try before I ask for help. But yep, I don't know much about coding. Questions will be asked.

About the images: So Elk will use always the default images? Also when there are images in my theme folder? Args...  :o
Title: Re: Needed files for custom themes
Post by: emanuele on February 25, 2015, 02:44:32 pm
Actually, that setting will work only on some images, not all of them: all the images loaded via css, are not affected by that setting, you'd have to change the css replacing the paths of all the images you want to be picked from the default theme, but honestly is not worth IMO.

Instead, check each and every image to decide if the one to pick if the one from the custom theme or the one from the default would be quite expensive (file_exists on each and every image would be a pain) and (again) not really worth IMO.

Anyway, maybe @TE has a better idea. O:-)
Title: Re: Needed files for custom themes
Post by: Jorin on March 06, 2015, 01:22:57 am
Seems not.  :D
Title: Re: Needed files for custom themes
Post by: TE on March 08, 2015, 01:35:51 am
Sorry, Cent help these days.  RL issues: my job is project based and  the main project isn't finished...