Closed LaocheXe closed 6 years ago
@LaocheXe What is the return value of the shortcode {VOICE_EXE}? Could you post some screenshots, how the "create sitelink" page looks before and after saving?
You could also have a look into the vstore plugin:
In e_header.php
https://github.com/e107inc/vstore/blob/master/e_header.php the menu item html is defined.
And in e_sitelink.php
https://github.com/e107inc/vstore/blob/master/e_sitelink.php the submenu get's defined.
https://github.com/LaocheXe/Voice-eXeSystem
Above images shows the Shortcode working via theme_shortcodes.php Below shows the Site Link Plugin Shortcode
Below shows what I have used/tried in Site Links in Admin Area
If I remove the Name 'VoiceLink' it still displays the " title=""> If I remove URL '{VOICE_EXE}' then it wont display {VOICE_EXE} - however, the dropdown link wont function wont work correctly. if I leave the URL alone and switch the Function from Voice to none, I still get the " title=""> Shortcode works in the *URL section, just the addtional " title=""> that shows up, and it's not in my Shortcode, in fact I have no title=""> in e_shortcode.php
@LaocheXe The 'title' displaying indicated broken HTML markup earlier on.
Whatever is in VOICE_EXE, please add the following right before your shortcode returns data.
Replace $text
with whatever you use in the shortcode.
e107::getDebug()->log($text);
then, enable 'basic' mode in the debugger to view the output in the footer.
First thing First. I did what you said, but I did not try the SiteLink Shortcode just yet.
With it On
Message: My Shortcode (creates link/dropddown menu) - Function: voice_shortcodes->sc_voice_exe()() (Where is the send () coming from?) - File: /e107_handlers/shortcode_handler.php Line: 264
@LaocheXe I suggest to use e_sitelink only and not place a shortcode in the URL field.
@CaMer0n I already have one - and tried it, same results - https://gist.github.com/LaocheXe/6a6b9314673f5e064cca895adbe48992 <-- whats in my e_sitelink.php
@CaMer0n Also, since I should use {SHORTCODE} in the url - what do I put there? Because URL is required.
Matter of fact, IDK how to use e_sitelink.php with my shortcode - using $voiceexe = {VOICE_EXE}; returns an syntax error. using $sc = e107::getScBatch('voice', true); $voiceexe = $sc->voice_exe; returns no error, but doesn't display at the top - but down at the bottom with debug plugin enable, I see it like in the screen shot above, where it displays the shortcode dropdown menu
@LaocheXe For URL just put #
Also, try adding this to your sitelinks function:
return $tp->parseTemplate("{VOICE_EXE}",true);
@CaMer0n that works some what.
Before:
Admin:
After:
Last Picture you see the 'Voice Plugin' name as a dropdown menu, but nothing is there - then you see 'Comms' dropdown (yes it works) - but breaks the navbar.
@LaocheXe I'm sorry, I can only guess now without seeing the source code.
@LaocheXe Okay, so this code is wrong:
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">'.$VoiPlug_Name.' <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
'.$voice_exe.'
<p></p>
</li>
<li class="divider"></li>
<li>
<a href="'.e_PLUGIN.'voice/voice.php">'.LAN_VOICE_VIEWERS.'</a>
</li>
</ul>
The sitelink function places code INSIDE the dropdown-menu. What you're providing is the code in the main-menu and the drop-down menu code. I suggest you replace this with a simple "hello world" and make your changes gradually and test regularly, so you'll know what in your code causes a break. Please see e107_plugins/_blank/e_sitelink.php for working examples.
@CaMer0n everything in the code looks fine but the
- which I should change that. only thing I can think of is maybe the
So maybe I should remove the html in that, just return the code - then maybe do a template?
You need to remove this:
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">'.$VoiPlug_Name.' <b class="caret"></b></a>
<ul class="dropdown-menu">
</ul>
And replace your <li>
items with <div>
See if that helps.
One step closer, just need to re-do the css for it, and kept the old style as well - thanks you your help/guidance.
Doing some testing and tried using my Voice eXe plugin in Site Links, using {VOICE_EXE} in the Url place - hit save, (no name) - notice that it displays in the main nav bar - just showing " title=""> (Also, it stretches the navbar so it can fit)
Now if I remove the Url - and put # then use the Function (Voice) - I get this: {VOICE_EXE} (No drop down menu).