Changed template IF statements/variables format and if we should rush updating them

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
Post Reply
User avatar
Dragosvr92
Registered User
Posts: 1470
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

Changed template IF statements/variables format and if we should rush updating them

Post by Dragosvr92 »

Ive been away from phpbb for about 6 years and i see the template IF statements format has changed in 3.3.3.

For example, this:

Code: Select all

<!-- IF postrow.POSTER_AGE --><dd><strong>{L_AGE}{L_COLON}</strong> {postrow.POSTER_AGE}</dd><!-- ENDIF -->
Now became, this:

Code: Select all

{% if postrow.POSTER_AGE %}<dd><strong>{{ lang('AGE') ~ lang('COLON') }}</strong> {{ postrow.POSTER_AGE }}</dd>{% endif %}
Is there a documentation about this explaining the advantage and should we rush into changing to the new format?
Last edited by thecoalman on Wed Apr 14, 2021 11:24 am, edited 1 time in total.
Reason: Moved to phpBB discussion.
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3726
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Changed template IF statements/variables format and if we should rush updating them

Post by Kailey »

Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5850
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Changed template IF statements/variables format and if we should rush updating them

Post by thecoalman »

The original is from phpBB's own template engine, the new formatting is from Twig.

https://twig.symfony.com/

I do not know the technical advantages such as performance. One huge advantage is someone who has expertise in HTML will probably already be familiar with Twig. It's utilized by multiple other web applications, Drupal for example.

I would imagine at some point support for phpBB's template engine will be dropped. That is personal comment and not from phpBB.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Changed template IF statements/variables format and if we should rush updating them

Post by david63 »

Also at some point (phpBB 4.0?) Twig syntax will be the only option as phpBB syntax will be dropped.
thecoalman wrote: Wed Apr 14, 2021 11:43 am I do not know the technical advantages such as performance.
If I am not mistaken phpBB's syntax is a wrapper of Twig so there is probably a slight improvement in performance but I don't think that it will be noticeable.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
Sajaki
Registered User
Posts: 1390
Joined: Mon Mar 02, 2009 1:41 pm
Location: Amsterdam
Contact:

Re: Changed template IF statements/variables format and if we should rush updating them

Post by Sajaki »

There is an extension that converts any style to Twig format,

viewtopic.php?t=2429096

it's super handy for this, takes 5 minutes to convert.
User avatar
Dragosvr92
Registered User
Posts: 1470
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

Re: Changed template IF statements/variables format and if we should rush updating them

Post by Dragosvr92 »

Thanks everyone ! The conversion extension is useful!
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3
Post Reply

Return to “phpBB Discussion”