Can someone explain template change on event to me?

Discussion forum for Extension Writers regarding Extension Development.
stubbo79
Registered User
Posts: 9
Joined: Wed Jul 03, 2024 11:56 am

Can someone explain template change on event to me?

Post by stubbo79 »

So I have an extension I'm working on (add a filter to the viewforum_body.php) that lets you filter topics based on a tag/assigned category.

I've found an event that is called within viewforum_body.php, and have my extension calling a function off the back of that event, with the goal that the function will insert the filter control within viewforum_body.php.

Question is, I don't want to edit the core style viewforum_body.php to include a {filtercontrol} tag, so how do I get the filter control that the function places to appear on viewforum_body.php?

I've tried creating a new version of viewforum_body.php with the tag in it inside of my extension (ext/author/filtertopics/styles/all/viewforum_body.php) but:

1. I can't get that to work and replace the default extension, and
2. I don't want to replace the file like that for fear of clashing with other extensions

So how does one go about inserting something on an existing front end page on-event, in the right place, without having to edit the existing page to include a tag to take the input?

Really grateful for any support on this.

Thanks?
rxu
Extensions Development Team
Posts: 3918
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Can someone explain template change on event to me?

Post by rxu »

viewforum_body.php doesn't exist in phpBB. Do you mean viewforum_body.html?
The rest of answers would depend on the actual extension code, the way you defined the {filtercontrol} tag etc.
More common questions are answered in phpBB Extension Development Tutorials.

Return to “Extension Writers Discussion”