[RFC|Merged] Enable template inheritance by default

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
User avatar
Arty
Registered User
Posts: 970
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

[RFC|Merged] Enable template inheritance by default

Post by Arty » Sun Jan 15, 2012 11:48 pm

Introduction
In phpBB 3.0.6 a new feature was added: template inheritance. It allows basic creation of child styles that include only modified template files. For example, if style author has modified only header/footer, template includes only overall_header.html and overall_footer.html

Many style authors are not aware of this function, making it harder for themselves to maintain styles. This also makes validation of styles a bit harder.

Proposal
Add template inheritance to prosilver and subsilver2, pointing to itself. During template installation, if template is pointing to itself for inheritance, ignore inheritance field.

Pros
When designers will create new styles, they will become aware of template inheritance and will automatically use it.
If designer does not want to use template inheritance, he can remove variable or point it to itself.

Cons
I don't see any

Notes
This RFC doesn't add any new features and won't break anything, so it can be implemented for 3.0.11

Implementation
Ticket: http://tracker.phpbb.com/browse/PHPBB3-10616
Pull request: https://github.com/phpbb/phpbb3/pull/549
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Enable template inheritance by default

Post by jsebean » Mon Jan 16, 2012 3:04 am

This sounds like a great idea. +1
-Jonah

User avatar
Mighty Gorgon
Registered User
Posts: 14
Joined: Wed Sep 17, 2003 8:52 am
Location: Italy
Contact:

Re: [RFC] Enable template inheritance by default

Post by Mighty Gorgon » Tue Jan 17, 2012 10:55 pm

Good idea, I agree on that.

User avatar
nextgen
Registered User
Posts: 128
Joined: Sat Jul 24, 2010 4:59 am
Location: Guatemala
Contact:

Re: [RFC] Enable template inheritance by default

Post by nextgen » Wed Jan 18, 2012 1:02 am

Sounds like a great idea. :)
*Imagine a signature super spectacular.*

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Enable template inheritance by default

Post by Oleg » Wed Jan 18, 2012 3:14 am

(18:21:56) cyberalien: I have a question about RFC process. Styles team had a meeting today, as a result I'll be posting bunch of styles related RFCs on area51. Problem is, those RFCs require each other in order to be implemented. Should I post them as one huge (really huge) RFC or post them as separate RFCs pointing to each other?
(18:22:36) cyberalien: I think separate RFCs would make discussion easier
(18:22:43) A_Jelly_Donut: pointing to each other AFAIK
(18:22:50) A_Jelly_Donut: err, many pointing to each other
(18:23:46) cyberalien: its like this: rfc#1 is small base rfc, rfc#2 requires #1 to be implemented, rfc#3 requires #1 and #2, rfc#4 requires #1-#3
(18:23:54) cyberalien: so like a chain of rfcs
(18:25:32) A_Jelly_Donut: yeah. just include a "depends on" section in each post with links
(18:25:37) cyberalien: ok
(18:50:24) igorw: yes, having them as separate RFCs definitely makes sense
(18:50:35) cyberalien: ok
(18:50:53) igorw: I'm quite curious to see them
(18:51:15) cyberalien: posted first two, working on others
(18:52:12) cyberalien: #1 is adding template inheritance by default, #2 is merge of style compoments, #3 is revamp of styles section in acp, #4 is cleaning up prosilver code. #3 reqiures #2
(18:52:53) igorw: ok, the dependencies aren't so chained after all
(18:52:55) igorw: and that's good
(18:53:17) cyberalien: and #1 can be implemented in 3.0.11, so it won't be a problem ether
(18:54:32) igorw: so looking at #1, and sorry to pester you already, this would just be adding the inherit line to the cfg file?
(18:54:49) cyberalien: yep and changing style installation a bit
(18:55:12) cyberalien: so a minor patch, only few lines of code to change
(18:55:21) cyberalien: others will be huge though
(18:56:13) igorw: sounds mostly like a documentation issue to me, as technically speaking there will not be much difference
(18:56:26) igorw: but if it helps, I'm not against adding it
(18:56:35) cyberalien: it will help, a lot
(18:57:20) igorw: I have tried to push the styles team towards promoting template inheritance in the past
(18:57:44) igorw: getting more of that is absolutely desirable
(18:59:44) cyberalien: i really like vbulletin way of handling inheritance: big tree of styles. want to edit one template? create a child style, edit that item. want to create many styles with that edit? create more child styles of that style. i do hope to see something like that in phpbb 4.0
(19:00:19) cyberalien: but its too early for that
(19:01:17) igorw: twig blocks and inheritance are definitely powerful features
(19:01:39) cyberalien: yep, very powerful

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Enable template inheritance by default

Post by Oleg » Wed Jan 18, 2012 3:15 am

Seems reasonable to me.

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Enable template inheritance by default

Post by callumacrae » Wed Jan 18, 2012 10:35 pm

+1
Made by developers, for developers!
My blog

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Enable template inheritance by default

Post by imkingdavid » Wed Jan 18, 2012 10:50 pm

I agree as well.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
naderman
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC] Enable template inheritance by default

Post by naderman » Thu Jan 19, 2012 1:51 pm

+1

Somebody want to work on a patch for this? :)

User avatar
Vinny
Style Customisations
Style Customisations
Posts: 126
Joined: Thu May 20, 2010 4:01 am
Location: Brazil
Contact:

Re: [RFC] Enable template inheritance by default

Post by Vinny » Thu Jan 19, 2012 4:32 pm

Arty wrote:This RFC doesn't add any new features and won't break anything, so it can be implemented for 3.0.11
Two patch will be needed:
naderman wrote:Somebody want to work on a patch for this? :)
Styles Team probably will work on that.

Post Reply