How to temporarily change variable in an event?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
moped
Registered User
Posts: 2
Joined: Mon Oct 23, 2017 9:19 am

How to temporarily change variable in an event?

Post by moped » Thu Jan 04, 2018 3:51 pm

Hello,

I'm working on a small extension, that will show some buttons in memberlist_view_user_statistics_after event, but because of this, I need to disable S_DISPLAY_SEARCH only for link that shows next to Total posts. How can I achieve this?

I tried to use {% set S_DISPLAY_SEARCH = 0 %} in memberlist_view_user_statistics_before but that doesn't work

User avatar
david63
Jr. Extension Validator
Posts: 14566
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: How to temporarily change variable in an event?

Post by david63 » Thu Jan 04, 2018 4:11 pm

Trace back to where it is set in a .php file and there should be an event following that, use that event to change its value
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

moped
Registered User
Posts: 2
Joined: Mon Oct 23, 2017 9:19 am

Re: How to temporarily change variable in an event?

Post by moped » Thu Jan 04, 2018 4:23 pm

That's why I've tried to use memberlist_view_user_statistics_before event. S_DISPLAY_SEARCH is used all over the template, so I need to disable it before the statistics and re-enable it just after them, preferably at the beginning of memberlist_view_user_statistics_after event.

It didn't work to just change it in .html using twig, so maybe I'm missing something, can you help me with a link to docs etc please?

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: alex75, Brf and 17 guests