[3.2][RC] Parameter Template Variables

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
User avatar
Registered User
Posts: 739
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

[3.2][RC] Parameter Template Variables

Post by martti » Tue Jun 19, 2018 12:51 pm

This extension already existed for some time for phpBB 3.1 but was not posted here. I updated it now for phpBB 3.2.1+ and PHP7+
Extension Name: Parameter Template Variables
Author: martti
Extension Description:
The extension makes all query parameters of the current url available in the template. They are all put under the template variable marttiphpbb_paramtempvars


Code: Select all

{%- if SCRIPT_NAME == 'ucp' and marttiphpbb_paramtempvars.i == 'pm' -%}
    This content is only visible in the private messages page in the UCP...
    Url: https://your-domain.org/ucp.php?i=pm
{%- endif -%}
To list all the query parameters you can do this:

Code: Select all

  {%- for key, value in marttiphpbb_paramtempvars -%}
  	<li>{{- key -}}: {{- value -}}</li>
  {%- endfor -%}
(You can play with this in the Custom Code extension.)

In the previous version (for phpBB 3.1) this extension made the query parameters available in the form of:

Code: Select all

This format is still available but depreciated.

Extension Version: 0.2.0
Requirements: PhpBB 3.2.1+ PHP 7+
Extension Download: https://github.com/marttiphpbb/phpbb-ex ... master.zip The files are to be put in ext/marttiphpbb/pramtempvars
Github repository: https://github.com/marttiphpbb/phpbb-ext-paramtempvars
Languages: n/a
Templates: all (n/a)
Screenshots: n/a

Post Reply

Return to “Extensions in Development”