Keyword

k2 tool - select category, open in new window

  • den_dhaeze
  • den_dhaeze's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 day ago - 9 years 1 day ago #147905 by den_dhaeze
tnav.mascomm.be/de-watermarkt

Hi,

I'm using K2 tools module on top of this page. it shows a dropdown of a lot of categories and subcategories. Is it possible to open a new window when you select a category? like target="_blank" in a html link. Now it opens in the same window.
Last edit: 9 years 1 day ago by den_dhaeze.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 day ago #147910 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 tool - select category, open in new window
I Keep getting "You don't have permission to access /de-watermarkt on this server."

If you are using the list you can override the module's output and add target _blank to the links.

If on the other hand you are using the select box, you need to add a small snippet in k2.js to open the links into a new window.
There are several examples in the forum on how to override the js file.
www.joomlaworks.net/forum/k2-en/39127-solved-how-to-unset-k2-js-file#136273

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • den_dhaeze
  • den_dhaeze's Avatar Topic Author
  • Offline
  • New Member
More
8 years 11 months ago #147988 by den_dhaeze
Replied by den_dhaeze on topic k2 tool - select category, open in new window
Hi,

Yes Krikor it's a select box. I was kind of hoping someone could help me with that snippet, cause I am not very familiar with writing javascript.

thanks anyway!

Michiel

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #148159 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 tool - select category, open in new window
You might need to hack the module a bit which is highly discouraged.
Since this is a simple module with only one output, there are no overrides.

So basically if you hack it, a simple typo could lead to a php error and you need to keep a backup of your edits for future uploads.

In the modules/k2_tools/helper.php locate the following block of code around line 639:
<select name="category" onchange="window.location=this.form.category.value;">

Change the window.location=this.form.category.value; part to:
window.open(this.form.category.value);

PS. Backup before you proceed with this edit.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum