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: PAGE_CONTAINER
At the very very bottom of the template, there's a "page_container_breadcrumb_bottom", but I'd like to see a "page_container_bottom" at the very bottom, to be able to include some js that I can't get into page_container_js_body.

This is no longer a requirement, as the new "body" template hook in 1.0.0 will work well with what I want to do.
 
I'd like maybe one more hook in the "message" template, one inclusive of the entire "<li>" that contains the message to place something like an ad above or below the nth message, that looks like a message. The new "ad_message_below" template in v1.0.0 almost works for me, but not quite.
 
I'm working on a add-on for pages markup, right now it's only functional use per page callback function, would be nice to have a hook for the pagenode_container around <article>{xen:raw $templateHtml}</article>

or is this something that can be done already? what does the <article> do?

K: 1.0.2
 
Template: user_edit (in admin center)

Some hooks inside the tabs (or to create own tabs) would be cool.
We have now some add-ons extending the userfields, but we would need to create a own admin controller page to be able to edit them.
It would be better to edit them in the user_edit formular.

K: 1.0.2
 
before and after raw template in pagenode_container would be epic, that way most customizations can be global, rather than per page node, we now have to use per page node call backs.
 
before and after raw template in pagenode_container would be epic, that way most customizations can be global, rather than per page node, we now have to use per page node call backs.

Agreed, I'm a site owner who wants to make XF fit my site , not have my site fit into XF theme. It's most annoying to have a site with a forum that doesn't visually match.
 
A hook in template member_recent_content would be usefull to be able to add own content types into the search footer
Code:
    <div class="sectionFooter">
        <ul class="listInline bulletImplode">
<xen:hook start>
  <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
            <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>

<xen:hook end>
    </ul>
    </div>

K: 1.0.2
 
Also a hook in member_view is needed.
There are also some links to the search, were it would be usefull if own content types would be able to add there searchlink.
Code:
<div class="section">
                    <h3 class="textHeading">{xen:phrase interact}</h3>

                    <div class="primaryContent">
                        <div class="pairsColumns contactInfo">
                            <dl>
                                <dt>{xen:phrase content}:</dt>
                                <dd><ul>
                                    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                </ul></dd>
                            </dl>

K: 1.0.2
 
A template hook in thread_view AFTER the quick reply form would be nice.
Instead of
Code:
<xen:hook name="thread_view_qr_before" params="{xen:array 'thread={$thread}'}" />

<xen:if is="{$canQuickReply}">
    <link rel="xenforo_template" type="text/html" href="quick_reply.html">
        <xen:set var="$formAction">{xen:link 'threads/add-reply', $thread}</xen:set>
        <xen:set var="$lastDate">{$lastPost.post_date}</xen:set>
        <xen:set var="$showMoreOptions">1</xen:set>
    </link>
</xen:if>

make pls:
Code:
<xen:hook name="thread_view_qr_before" params="{xen:array 'thread={$thread}'}" />

<xen:if is="{$canQuickReply}">
    <link rel="xenforo_template" type="text/html" href="quick_reply.html">
        <xen:set var="$formAction">{xen:link 'threads/add-reply', $thread}</xen:set>
        <xen:set var="$lastDate">{$lastPost.post_date}</xen:set>
        <xen:set var="$showMoreOptions">1</xen:set>
    </link>
</xen:if>
<xen:hook name="thread_view_qr_after" params="{xen:array 'thread={$thread}'}" />

K: 1.0.2
 
Can we get a hook or two in sidebar_online_users? Would be useful for add-ons to add sidebar blocks. Or am I missing something? lol
 
Can we get a hook or two in sidebar_online_users? Would be useful for add-ons to add sidebar blocks. Or am I missing something? lol

There are some hooks forum_list_sidebar, sidebar_visitor_panel_stats,page_container_sidebar (that's the one i'm using for all my add-ons and what you're searching for^^)

PHP:
    public static function templateHook($name, &$contents, array $params, XenForo_Template_Abstract $template)
    {
        if ($name == 'page_container_sidebar') {
            $options = XenForo_Application::get('options');
            $limit = $options->ragtek_NM_counter;
            $latestUsers = XenForo_Model::create('Ragtek_FW_Latest')->getLatestUsers($limit);
            $params = array(
                'latestUsers' => $latestUsers
            );

            $t = $template->create('ragtekNM', $params)->render();

            $search = '<!-- end block: sidebar_online_users -->';
            $contents = str_replace($search, $search . $t, $contents);
        }
    }
will add an block UNDER the online users (http://xenforo.com/community/threads/ragtek-newest-members-sidebarblock.14906/ )
 
There are some hooks forum_list_sidebar, sidebar_visitor_panel_stats,page_container_sidebar (that's the one i'm using for all my add-ons and what you're searching for^^)

PHP:
    public static function templateHook($name, &$contents, array $params, XenForo_Template_Abstract $template)
    {
        if ($name == 'page_container_sidebar') {
            $options = XenForo_Application::get('options');
            $limit = $options->ragtek_NM_counter;
            $latestUsers = XenForo_Model::create('Ragtek_FW_Latest')->getLatestUsers($limit);
            $params = array(
                'latestUsers' => $latestUsers
            );

            $t = $template->create('ragtekNM', $params)->render();

            $search = '<!-- end block: sidebar_online_users -->';
            $contents = str_replace($search, $search . $t, $contents);
        }
    }
will add an block UNDER the online users (http://xenforo.com/community/threads/ragtek-newest-members-sidebarblock.14906/ )
Well, look at that. Do you know if there's a way to inject something under "Staff Online Now"?
 
Well, look at that. Do you know if there's a way to inject something under "Staff Online Now"?
yep.
use my code but search for
<!-- end block: sidebar_online_staff -->

instead of $search = '<!-- end block: sidebar_online_users -->';
 
Well, look at that. Do you know if there's a way to inject something under "Staff Online Now"?

if you do it that way, make sure that you replace the used remark hook in YOUR template (At the very bottom of your template) as well so that others can hook in...
 
if you do it that way, make sure that you replace the used remark hook in YOUR template (At the very bottom of your template) as well so that others can hook in...

that's what i'm doing with
PHP:
            $search = '<!-- end block: sidebar_online_users -->';
            $contents = str_replace($search, $search . $t, $contents);
 
Top Bottom