phpbb-extensions / boardrules

Board Rules extension for phpBB

Home Page:https://www.phpbb.com/customise/db/extension/boardrules/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Style - All

Pico opened this issue · comments

IMO prosilver template and theme files should be also placed in all folder.

https://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=41499&p=265161#p265161 and previous posts

I was just thinking the same thing last night!!!

We should put all Prosilver fles into "all" since it is likely there will be new styles that may have templates (like overall_header) that do not inherit from Prosilver, but would still have a high probability of being compatible with our templates.

By using Prosilver as we do now, we increase the need to build 3rd party specific templates. By using the all folder now, I think we'll actually be more compatible, as then we'd only need to build 3rd party templates when they truly do not work with Board Rules.

No matter what we should have something in all to default to and the original idea was prosilver should be used for that as subsilver is being deprecated.

Odd... I moved all prosilver stuff into the all folder.. And it doesn't work. The controller template file, it wants it to be in prosilver folder, not in all! Events work, but not controller templates ?!?!
Unable to find template "boardrules_controller.html" (looked into: ./styles/prosilver/template).

i don't know if this is by design or bug/limitation

Now I'm more confused but also clear 😉

It appears that using a "prosilver" folder works kind of like an "all" folder.

I set up a custom style with no parent inheritance. The template and theme files in the "prosilver" folder work with this custom style.

So I believe it works like this:
Looks for style files in a folder named for the current style first.
Then it looks for them in "prosilver".
Then it looks for them in "all" (except for template files called using the helper->render() method).

So it looks like it is in fact correct to use the "prosilver" folder for most style files.

The "all" folder should be used for files that would otherwise be duplicated in each style.

Based on all that, our current style folder is configured correctly. The "all" folder contains only a JS file which is identical for all styles. And the "prosilver" folder houses all our "modern" style files based off prosilver. Finally the "subsilver2" folder holds all our subsilver2 specific files.

It should definitely not include prosilver for a style which does not
inherit from prosilver at all. Please open a bug for phpbb.
On Jun 3, 2014 8:46 PM, "Matt Friedman" notifications@github.com wrote:

Now I'm more confused but also clear [image: 😉]

It appears that using a "prosilver" folder still works kind of like an
"all" folder.

I set up a custom style with no parent inheritance. The template and theme
files in the "prosilver" folder work with this custom style.

So I believe it works like this:
Looks for style files in a folder named for the current style first.
Then it looks for them in "prosilver".
Then it looks for them in "all" (except for template files called using
the helper->render() method).

So it looks like it is in fact correct to use the "prosilver" folder for
any style files written in prosilver code.

The "all" folder should be used for files that would otherwise be
duplicated in each style.

Based on all that, our current style folder is configured correctly. The
"all" folder contains only a JS file which is identical for all styles. And
the "prosilver" folder houses all our "modern" style files based off
prosilver. Finally the "subsilver2" folder holds all our subsilver2
specific files.


Reply to this email directly or view it on GitHub
#118 (comment)
.

$names[] = 'all'; should be added to set_style method in template\twig\twig.php

I was wrong. I changed my styles to not inherit. But I didn't realize I had to uninstall and then reinstall the style for the inheritance change to take effect.

So it does not load from prosilver unless it is inherited after all.

But there is still a bug where helper->render() does not search in the "all" folder for potential controller templates

Reported: https://tracker.phpbb.com/browse/PHPBB3-12661

This means we would be able to put everything into "all" except for the controller template file (unless the bug gets fixed)

PR that fixed that phpbb/phpbb#2546

Looking at the files I think things could be organized like this once the all folder is working for controllers.

all:
boardrules_controller.html
event/ucp_agreement_terms_after.html
event/overall_header_head_append.html
theme/boardrules_controller.css

prosilver:
event/overall_header_navigation_append.html
theme/boardrules_common.css
theme/images/*

maybe that remaining prosilver folder stuff can go into all too, though that is the only stuff that I would consider somewhat prosliver specific (ie: it wouldn't work in some subsilver2 based style).

My PR is merged, so we can solve that issue.

I've thought about this some more and I do not think we really need to to change anything, at least not for now.

All new styles for 3.1 should be inheriting from either subsilver2 or prosilver. So only styles which choose NOT to inherit will be at issue, but those should be very few, if any, and most likely if a style is so different it can't inherit from one of the base styles, then there will probably be design incompatibility with our template files anyway.

For now, keeping prosilver in the prosilver helps signal that those files are specifically designed for prosilver based styles, and what we have in our "all" folder right now, are files that truly can be used by any style without compatibility issues.

We can wait and see what happens when other styles come out in the future, and make any changes if needed then.

VSE is right.

If we're including prosilver and subsilver2 files, we shouldn't move prosilver into all. Just as prosilver template files don't work correctly on subsilver2, they likely would not work on any style not based on (inheriting from) prosilver.

"All" we would use for things compatible with all styles or if we choose not to include prosilver and subsilver2.

Closing this issue for now then.