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.
I can't find my previous suggestion so here once again:

Pls move
<!-- block: sidebar_online_staff -->
....
<!-- end block: sidebar_online_staff -->
outside of the if condtion.

If an add-on uses this for adding own sidebar blocks, it will break if no staff members are online/visible.
 
In the Message template I would love to get a template hook in between the <LI> tag and the include messager_user_info.

Useful for putting a custom title bar on top of each message, or maybe an advertisement before the first message.

PHP:
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'}" data-author="{$message.username}">

 <xen:hook name="message_header" />

    <xen:include template="message_user_info">
 
Template: login_bar_form to be able to add own providers without template edit

Code:
<xen:comment>
With Javascript enabled, this form will be moved at page init time,
with the command $('#login').appendTo('#loginBar .pageContent');

Note that all external auth checks need to be added to the conditional below
in order to set $eAuth = 1 if any external auth providers are available.
</xen:comment>

<xen:if is="{$xenOptions.facebookAppId}"><xen:set var="$eAuth">1</xen:set></xen:if>
how should we set own auth providers without an template hook or any other mechanism and without template edits:p
 
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}'}" />
I'm upset these hooks still aren't in 1.1...
 
You can use template_post_render to prepend or append to any "page level" template (and both of those templates are).
Well there are some <xen:> commands that dont work in template_post_render. It would just be easier if the hooks were added... and its not like it's that much work for you guys =P
 
Well there are some <xen:> commands that dont work in template_post_render. It would just be easier if the hooks were added... and its not like it's that much work for you guys =P
Er... what commands would those be?
 
Implemented most of these now, though Mike is right about appending to forum_view and thread_view - if you want to use template syntax, you just need to create a new XenForo_Template object inside the template_post_render listener, render it and append the output.
 
Should there be a subforum for template hook requests ?
One hook request per thread.
Such that everyone (xF + requesters) can track the status of the requests ?
Maybe the Prefixes could be implemented ?
 
Would it be possible to get hooks around each of the built in sidebar items? I'm trying to do some edits to change the appearance of a few of them and would much rather do it with template hooks then direct edits. Thanks!
 
A hook in the admin template forum_edit would be terribly useful for extending functionality/options of the forum nodes. Probably the edit template for all node types would be useful as well. Would certainly make it cleaner when adding new settings for each node/forum.
 
Additional to digitalpoints forum_edit request=>

Pls add a hook to ALL nodetype edit pages (forum,category,forumlink!
I've forgotten to request this as i requested page_edit :(
 
You can use template_post_render to prepend or append to any "page level" template (and both of those templates are).
How would I add the following template using that method? As far as I know, <xen:sidebar> fails...
Code:
<xen:require css="EWRporta.css" />

<xen:if is="{$blocks.btm-left}">
<div class="sidebar btmLeftBlocks">
    <xen:foreach loop="$blocks.btm-left" value="$block">
        {xen:raw $block}
    </xen:foreach>
</div>
</xen:if>

<xen:if is="{$blocks.btm-right}">
<div class="sidebar btmRightBlocks {xen:if '{$blocks.btm-left}', 'centerShift'}">
    <xen:foreach loop="$blocks.btm-right" value="$block">
        {xen:raw $block}
    </xen:foreach>
</div>
</xen:if>

<xen:if is="{$blocks.sidebar}">
    <xen:sidebar>
        <xen:foreach loop="$blocks.sidebar" value="$block">
            {xen:raw $block}
        </xen:foreach>
    </xen:sidebar>
</xen:if>

<xen:include template="EWRporta_Footer" />
 
Top Bottom