phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Styles structure, updates, editing

Discuss the future of phpBB. It is still nesting in its mother's womb, but it will grow a little bigger each day. Participate in its design & planning here.

Styles structure, updates, editing

Postby Arty » Tue Feb 07, 2012 12:17 pm

Some ideas for styling system in phpBB 4.

Styles structure.

I think styles should use tree system without level limitations instead of flat system that phpBB 3 uses. In phpBB 3 template inheritance allows only 1 level deep trees: main style + style that reuses templates. Like this:
- Default style (prosilver)
- - Customized colors (changing colors in css and some images)
- - - Customized header/footer (custom header and footer blocks)
- - - - Custom style <-- this style is available for selection to users

Such tree structure should apply not only to templates, but to everything: css files, scripts, images. There should be some kind of resource manager that handles it.

Each style should have these options:
- Style id
- Style name
- Parent style id
- Flag: if style can be selected
- Extra data: author name, version name, automatic update URL

Requesting any resource would look like this (for example, images/logo.png):
- Client requests styles/custom_style/images/logo.png
- Resource manager checks for that file. If not found, it checks for styles/customized_header/images/logo.png (see sample styles tree above). If not found, it checks for styles/customized_colors/images/logo.png and so on until it reaches main style.

Each resource could be stored in database instead of file system. Storing everything in database would allow scaling forum over multiple servers.

There should be one main style, like prosilver in phpBB 3. It should not be available for editing by administrator. All addons should add their code to that master style via hooks system.

Benefits of such system:
- Different edits could be done in different styles, allowing to easily enable/disable some edits without redoing whole style.
- Forum owner will be able to customize only items that he wants to customize without copying many files.
- It would be easy to roll back to original file, making updating and maintaining styles much easier.


Editing styles.

Some styles should not be available for editing:
- Main style.
- Any style that has automatic update URL in meta data (should apply to most downloaded styles).

This would allow updating styles without messing up custom changes.

If resources could be stored in database, there should be multiple ways of accessing resources:
- Via admin control panel.
- Via interface that maps database to file system.


Editing resources remotely

For mapping database to file system a good option is WebDav. It would allow accessing templates from database as if they were usual files, so users could edit templates like in phpBB 3.

Advantages of using system like WebDav:
- Resources would be stored in database, making it easier to run forum on multiple servers.
- It uses its own authentication, so access could be set in admin control panel. People editing files will use their forum credentials to access it. Additional administrators will not have access to FTP.
- Possibility of storing old resources in history, allowing for backup and rollback.
- Easy to track which admin edited resources.
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 796
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: Styles structure, updates, editing

Postby brunoais » Sat Feb 11, 2012 4:45 pm

Hum...
I'm kinda against this.
I think the idea behind what should be done is:
We should make a big discussion about which info should exist in each page.
Form that discussion we should get conclusions.
After that we create the HTML output to create the output depending on the page we are outputting.
The HTML will be filled with classes and it should be minimally structured (just a small, simple generalized skeleton). I'm thinking an average of 4 different class names for each HTML tag.
HTML tags will be building blocks and the CSS will fit the blocks in their place as the theme needs, in other words, the CSS will take care of showing/getting everything in place to look good to the user.
Javascript will come along to make things less static and to allow some animations and to get AJAX calls to speed things up and let things be more dynamic.

Some hooks should be placed in the HTML generator so that extensions can add functionality to the system by altering the HTML itself, when needed. This should be done the equivalent way as it is with the current template system.
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm


Return to [4.x] Discussion

Who is online

Users browsing this forum: DavidIQ and 5 guests