Implemented Template Hooks

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
Sure that the Beta 3 Templates are ok?

I couldn't find any <xen:hook> in the templates.
We have the code listener but how can we use it without hooks in the templates?
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
Template quick_reply

Add a hook surrounding the form pls:) (and / or a "html comment" to be able to attach own buttons & fields to the form with help of the html comment)
 
there are enough theme customisations that involve sidebar_online_users that i reckon we need a hook.
right now there are numerous edits for using avatars in members online, rearranging/changing how staff are shown, edits to recolour users in the list, etc etc.
 
A hook surrounding the title otuput in:
thread_list_item
thread_list_item_deleted

(and all templates containing <!-- TODO: Thread prefix here --> ;) (e.g search results,...)
 
A hook in template thread_list_item_edit & inline_mod_controls_thread would be also very useful to be able to add own inline mod options
 
Once i know if/how it's possible to add own criteria to the search a hook in Template search_form_post inside the Form, would be useful, to be able to add own "criteria" fields for threads & posts
 
I wish the 'what is new' , 'no results found' error that's spit out is not just the default page with a phrase spit out, but a much more advanced setup where we can hook into.

I made a modification that lets the admin go through settings and it pulls known data from the forum to help populate it. But it's code-modification, and dirty at that.

It would be so great if the result page not found would auto link to the right twitter/facebook feed for a line that says 'done reading all the content here? check out our facebook page or talk to us on twitter'

If there's a real page there, with a hook. We can hook into existing plugins, show popular content. Invite users to review social profiles, or point them out to specific topics, etc.

The mod does it all, but it would be awesome if there's a page/hook we can manipulate to achieve it (that way it's also a much nicer solution to share with the community here)

find-new/threads/ (no results) > only has a phrase.
 
I wish the 'what is new' , 'no results found' error that's spit out is not just the default page with a phrase spit out, but a much more advanced setup where we can hook into.
you can overwrite it and output whatever you want!!!??
Just use a template and use this->reponseView instead of responseMessage in getNoResultsResponse :p

PHP:
    public function getNoResultsResponse()
    {
        $this->responseView('', 'my_new_page');
    }
 
you can overwrite it and output whatever you want!!!??
Just use a template and use this->reponseView instead of responseMessage in getNoResultsResponse :p

PHP:
    public function getNoResultsResponse()
    {
        $this->responseView('', 'my_new_page');
    }
I feel I am missing something .. continue in privmsg?
 
Is it possible to update templates to pass params to ad hooks (e.g. ad_message_below, ad_message_body and others)?

As for message hooks, now they are completely useless as there is no way to get message position on page within these hooks and show ads after the first message or in the first message...
 
I'd like to see a hook in thread_list_item around the icons, to add new thread flagging types as necessary. I added hook thread_list_item_iconKey to my own board, to support an add-on that flags threads that have a reply from members of certain user groups. This is the only template edit that was needed to make everything work.
PHP:
            <xen:if hascontent="true">
                <div class="iconKey">
                <xen:contentcheck>
                    <xen:hook name="thread_list_item_iconKey" params="{xen:array 'thread={$thread}'}">
                        <xen:if is="{$thread.isModerated}"><span class="moderated" title="{xen:phrase moderated}">{xen:phrase moderated}</span></xen:if>
                        <xen:if is="!{$thread.discussion_open}"><span class="locked" title="{xen:phrase locked}">{xen:phrase locked}</span></xen:if>
                        <xen:if is="{$thread.sticky}"><span class="sticky" title="{xen:phrase sticky}">{xen:phrase sticky}</span></xen:if>
                        <xen:if is="{$thread.isRedirect}"><span class="redirect" title="{xen:phrase redirect}">{xen:phrase redirect}</span></xen:if>
                    </xen:hook>
                </xen:contentcheck>
                </div>
            </xen:if>
 
Unfortunatelly no. I'm creating an Ads Manager by request and want to insert ads using hooks, not manually (by changing ad templates).
Each ad template has a hook inside it.

2011-09-19-19h42_24.png

Code:
<xen:hook name="ad_thread_view_below_messages" />

Simply hook into it as you would usually..

PHP:
switch ($templateHook) {
    case 'ad_thread_view_below_messages':
    // do stuff
    break;
}
 
Each ad template has a hook inside it.
I know, that each template has a hook and I know, how to use them. I just need to pass some params to hook. For example, I need pass an array, containing post data to ad_message_below hook. Yes, I can manually change ad_message_below hook, but maybe this should be done by XF developers?
 
I know, that each template has a hook and I know, how to use them. I just need to pass some params to hook. For example, I need pass an array, containing post data to ad_message_below hook. Yes, I can manually change ad_message_below hook, but maybe this should be done by XF developers?
Sorry, didn't understand your original question, now I do. I thought you could pass args to a hook to make that data available in the template? Been some time since I played with the XenForo system, though...
 
Template thread_create

A hook surrounding the form + several "html comments" after each field, so we can place own inputfields where we want...

Reason:
I want to add several input fields before & after the poll Input Fields
 
To be sure that we don't need to wait for xf >= 1.1.1

Pls add a Template hook in the Profile Field Form, so we're able to add own input fields
Screen Shot 2011-09-21 at 13.40.59.webp
 

Okay... there are two hooks that I need that I am absolutely amazed don't already exist...

At the absolute bottom of "thread_view"
Code:
<xen:hook name="thread_view_share_after" params="{xen:array 'thread={$thread}'}" />

At the absolute bottom of "forum_view"
Code:
<xen:hook name="forum_view_pagenav_after" params="{xen:array 'forum={$forum}'}" />
 
Top Bottom