Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2015, 10:53 AM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 10-30-2015, 11:23 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not create it with the navigation manager?
Reply With Quote
  #3  
Old 10-30-2015, 11:29 AM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
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.
Reply With Quote
  #4  
Old 10-30-2015, 11:34 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe it's the "navbar_end" template hook.
We're talking about the sub-menu under the main navbar right?
Reply With Quote
  #5  
Old 10-30-2015, 11:34 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
RichieBoy67
  #6  
Old 10-30-2015, 02:25 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
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 View Post
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.
Reply With Quote
  #7  
Old 10-30-2015, 02:39 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>'

Reply With Quote
  #8  
Old 10-30-2015, 02:41 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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.
Reply With Quote
  #9  
Old 10-30-2015, 02:43 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NickTheGreek View Post
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.
Reply With Quote
  #10  
Old 10-30-2015, 02:46 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>'

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09816 seconds
  • Memory Usage 2,288KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete