SMF Development > Next SMF Discussion

[3.0] Redo the theme system for SMF (2.1+ obviously)

<< < (2/7) > >>

Vekseid:

--- Quote from: Motoko-chan on June 29, 2009, 05:25:21 PM ---Not sure what you mean by replacing original files instead of providing new. How do you expect SMF to detect what to use where?
--- End quote ---

Formalize adding a language entry.


--- Quote ---Yep, it is. It has been this way in all the public preview releases. Check the setupMenuContext function in Subs.php. You'll find an array the sets up the menus and all submenu items. If you are writing a modification that makes menu changes, it should go there. If you are working on a theme, it should use this function. Refer to the default theme for how to handle things if you don't know.

--- End quote ---

Subs.php is not 'its own file'. Subs.php is 1) a php file, which is exactly the wrong place for this sort of thing and 2) critical to the functioning of the forum if something refuses to work. The menu does not belong there, at all.


--- Quote ---What do you mean by no ability to add things? Edit the default theme files and if you are just using CSS, then the new stuff should show up in all themes.

--- End quote ---

'edit the default theme' - no. The whole point of the exercise is that adding something like a shoutbox or arcade should require no theme edits. Period. Not via mod edit, not manually. Files may be added, but never edited or replaced.

SMF's theming is its most widely criticized weakness. There's a reason for this, it would be awesome to see it addressed.

bloc:

--- Quote from: Vekseid on June 29, 2009, 05:44:30 PM ---SMF's theming is its most widely criticized weakness. There's a reason for this, it would be awesome to see it addressed.

--- End quote ---

It is? Whats the reason for that, in your opinion?

Kindred:
Personally, I think SMF's theming system is one of the more powerful ones out there.... The power just doesn't happen to be widely used because it's simpler to make a quick modification to CSS and call it a new theme.

live627:
I propose sub templates can have two prefixes, template_ and template_custom_ so that custom themes can define only the templates they actually modified. Also I'd like to see multiple sub-templates per page.

青山 素子:

--- Quote from: live627 on September 20, 2011, 07:39:05 PM ---I propose sub templates can have two prefixes, template_ and template_custom_ so that custom themes can define only the templates they actually modified.

--- End quote ---

You can already do this. If you don't modify a template file, don't include it in the theme directory. SMF will use the template file from the "default" directory in this case.

Most simple themes will only need to include index.template.php. If they only touch the CSS and images, they won't need to include any template file.



--- Quote from: live627 on September 20, 2011, 07:39:05 PM ---Also I'd like to see multiple sub-templates per page.

--- End quote ---

Not sure what you mean or how that would work.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version