vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Hook after Quick Links?? (https://vborg.vbsupport.ru/showthread.php?t=320653)

TheAdminMarket 10-30-2015 10:53 AM

Hook after Quick Links??
 
Hello,

I'm trying to add a simple menu link after "Quick Links", but I was never good enought to locate the correct hook. Can someone helps?

Code:

<plugin active="1" executionorder="30">
        <title>Forum Link</title>
        <hookname>cache_templates</hookname>
        <phpcode><![CDATA[
                $templater = vB_Template::create('teamtalk_forum_link');
                $template_hook['navtab_end'] .= $templater->render();
        ]]></phpcode>
</plugin>

and the simple template is:
HTML Code:

<template name="teamtalk_forum_link" templatetype="template" date="1160112327" username="ChrisTERiS" version="1.0.0"><![CDATA[
<li id="vbflink_teamtalk">
<a href="teamtalk.php">{vb:var vbphrase.teamtalk_global}</a></li>
]]></template>

Thank you

ozzy47 10-30-2015 11:23 AM

Why not create it with the navigation manager?

TheAdminMarket 10-30-2015 11:29 AM

Quote:

Originally Posted by ozzy47 (Post 2557889)
Why not create it with the navigation manager?

I don't want Tab. Just a Link in forum. Never tried to add something like this with a product file.

Dave 10-30-2015 11:34 AM

I believe it's the "navbar_end" template hook.
We're talking about the sub-menu under the main navbar right?

ozzy47 10-30-2015 11:34 AM

I know, you can make a link, and assign it to a product with the nab manager. :) So when you export your product XML it will have the navigation entry with it.

TheAdminMarket 10-30-2015 02:25 PM

Quote:

Originally Posted by Dave (Post 2557893)
I believe it's the "navbar_end" template hook.
We're talking about the sub-menu under the main navbar right?

I tried but does not works :(
Anyway thank you David

--------------- Added [DATE]1446218808[/DATE] at [TIME]1446218808[/TIME] ---------------

Quote:

Originally Posted by ozzy47 (Post 2557894)
I know, you can make a link, and assign it to a product with the nab manager. :) So when you export your product XML it will have the navigation entry with it.

I also tried this but adding a link is blocked (read only) to vBulletin product. I can't assign it to another product.

MarkFL 10-30-2015 02:39 PM

What I did in one of my products to add a link to the "Quick Links" drop-down menu is use the plugin hook "global_setup_complete" and the plugin code:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks").lastElementChild;
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.appendChild(newlink);
    }
</script>'



TheAdminMarket 10-30-2015 02:41 PM

Finally I created a Tab menu for it and if someone wants to move it somewhere he can do it by copying the link and permissions. :)

--------------- Added [DATE]1446219813[/DATE] at [TIME]1446219813[/TIME] ---------------

Quote:

Originally Posted by MarkFL (Post 2557902)
What I did in one of my products to add a link to the "Quick Links" drop-down menu is use the plugin hook "global_setup_complete" and the plugin code:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks").lastElementChild;
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.appendChild(newlink);
    }
</script>'



Tried your solution Mark but does not seems to work.

Paul M 10-30-2015 02:43 PM

Quote:

Originally Posted by NickTheGreek (Post 2557891)
I don't want Tab. Just a Link in forum. Never tried to add something like this with a product file.

Still just add a link in nav manager, and associate it with your product.

When you export the product, it will export the link in the xml.

MarkFL 10-30-2015 02:46 PM

Christos, try:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks");
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.lastElementChild.appendChild(newlink);
    }
</script>'




All times are GMT. The time now is 06:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.40851 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete