Jump to content
Sign in to follow this  
rogerr

menue hook target attribute

Recommended Posts

Hi!

I have created a hook to embed a new link in the primary navigation.
this is an external link, so i would like to add an  target="_blank" to open a new tab for this link.

may someone can give me a hint?

here my code:

 

  if (!is_null($primaryNavbar->getChild('Support'))) {
$primaryNavbar->getChild('Support')->addChild('FAQ-extern')
            ->setUri('https://www.example.com/')
            ->setOrder(30);
  }

 

Thank you!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By ramf
      Hi,
      When I'm creating a client I'm using the ClientAdd hook so that any information added when creating the client will be sent to another system as a webhook.
      I can do it without a problem and everything is working well - except getting the client custom fields information.
      I know that I can call this information separately with a nother get command - but this is not what I'm looking for. 
      In the hook documentation it is only mentioned that the customFields Variable is a array Type.
      Can someone give me a code example to show how can I incorporate the custom fields information that got added when creating the client?
      This is the code I'm using now - sorry this is a picture since I'm getting 403 Forbidden when trying to add it directly to the ticket....

       
      The only part missing is the information added to the  custom fields during the client creation and got triggered with the ClientAdd hook.
      Thanks!
      Ram
    • By Dreza
      Hello,
      I created a hook file for the 'OrderPaid' event and it seems like the $vars variable that is being passed to it always comes up empty. Does anyone know why this is happening?
    • By Dreza
      Hello,
      I created a hook file for one of my addon modules and it seems like the hook event is always happening. The hook event is 'OrderPaid'.
      When I look at the module logs there is an entry for this hook event every minute even though no orders have been paid for during this time.
      I need to know why this is happening. If anyone can help me I would appreciate it.
    • By Marcos
      Hi All
      First of all, I cannot locate any hook that is triggered upon changing a Client's Ownership.  UserEdit is fired but seemingly BEFORE the User is assigned the Client, and no Client details are passed to the hook (I access them directly via de DB).
      Any suggestions on how to trap this event?
      Thank you in advance.
    • By ramf
      Hi,
      Can someone please help me with this hook? 
      It was created by @brian!  and appeared here- but sadly he can't help me. 
      Since I'm selling mostly one time products - I have lots of inactive clients and I want to be able to find them easily without the hassle of  changing the search toggle.
      There it this feature request  that was opened 2 years ago to make the hide inactive clients optional (please vote) - but until this happens I have no choice but to use this hook:
       
      <?php add_hook('AdminAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'clients' OR in_array($vars['pagetitle'], array(AdminLang::trans('services.title'), AdminLang::trans('services.listaddons'), AdminLang::trans('services.listdomains')))) { $autoPost = <<<HTML if ($('input#checkboxShowHidden').is(':checked')) { $('body').addClass('hidden'); $('#checkboxShowHidden').click(); } HTML; } return <<<HTML <script> $(document).on('ready', function() { if ($('input#intelliSearchHideInactiveSwitch').is(':checked')) { $('#intelliSearchHideInactiveSwitch').click(); } {$autoPost} }) </script> HTML; }); The problem with this one is that the search bar is always opened with this error - in every page loading:
      So even If i'm not clicking on the search field - the search bar is opened with this message.
      Can someone help me figure out what should be changed in this hook file so it will not open the search bar automatically - but when we do search we will see the inactive clients alongside the active onse?
      Thanks!
       

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated