Keyword

Hide attachments link on k2 item

  • Soundific Rep
  • Soundific Rep's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #120807 by Soundific Rep
Hide attachments link on k2 item was created by Soundific Rep
I have a site where an mp3 player script reads the attachment filename and on the item.php page is able to play it. My problem is that i do not want people to be able to see the attachment link because i want to be able to sell the mp3 file. If i just hide the attachment link from the item page , then the mp3 player script cannot play the file.
So what i want is for the mp3 player script to be able to read the attachment filename without having to show the link on the item page.

thanks for your time.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #120808 by Yiota
Replied by Yiota on topic Re: Hide attachments link on k2 item
Maybe you could hide it after the page is loaded and the script fetches the filename it requires in order to play. I believe with some javascript you could achieve that.

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

  • Soundific Rep
  • Soundific Rep's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #120809 by Soundific Rep
Replied by Soundific Rep on topic Re: Hide attachments link on k2 item
good but a bit general to work a solution :(

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #120810 by Yiota
Replied by Yiota on topic Re: Hide attachments link on k2 item
Try putting something like the following in your template's javascript file:

$(window).load(function() {
setTimeout( function(){
$("CLASS_OF_ATTACHMENT_ELEMENT").removeAttr('href');
},100);
}
});

If you already use the load function then just put the timeout at the bottom.

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


Powered by Kunena Forum