Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to open links presented by Rss feed plugin "Simple Rss" in new tab

Anyone can indicate me on how to open the links from the rss feed plugin "Simple Rss" in a new tab automatically in stead of opening on the same page of my forum site ?

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited September 2016

    Try the Target_Blank plugin…

    or modify line 61 of the simplerss.php file…

    echo wrap(anchor(t('More…'), $this->data('SimpleRSS')->channel->link), 'li', array('class' => 'ShowAll'),array('target'=>'blank'));

  • @vrijvlinder I tried both. Both don't get the job done.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited September 2016

    Sorry about that. This is not my plugin and I can't think of anything except to add some javascript to your default.master.tpl , to make all links you want to open in new windows…Here is an example of how to do that for various classes of links.

    {literal}<script type="text/javascript"> 
    //this script is to make the links open in another window or the same window.
    jQuery(document).ready(function($) {
    $('.MessageList a').attr('target', '_blank');
    $('#Foot a').attr('target', '_blank');
    $('.AptAdImg a').attr('target', '_blank');
    $('.Attachment a').attr('target', '_blank');
    $('.Meta a').attr('target', '_self');
    $('#Foot li:last > a').attr('target', '_blank');
    $('a.ReactButton.Quote.Visible').attr('target', '_self');
    });
    </script>{/literal}
    
  • Thanks for the last tip. It directed me to the idea of editing the below script in default.master.php from darkmetal and to just add the line that I need and it worked. Two things I'm still working on is to open VChat in a new tab and to separate the discussion topics from opening in a new tab while the Simple RSS feeds continue to open in a separate tap. They seem to fall under the same class "Title".

    jQuery(document).ready(function($) { $(".Attachment a").attr("target", '_blank'); $("#Foot a").attr("target", '_blank'); });

    **
    Changed to : **

    jQuery(document).ready(function($) { $(".Attachment a").attr("target", '_blank'); $('.Item a').attr("target", '_blank'); $('.ShowAll a').attr("target", '_blank'); $('.sub-menu a').attr("target", '_blank'); $("#Foot a").attr("target", '_blank'); });
  • Sorry, the script in my comment was not meant to become a mess. Need to avoid that the next time.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yea, I forgot you are using my theme so that block of jquery was already there.
    That is the easiest way to go if it works for you.

    Just do not use {literal} tags because that is only for a tpl master.

Sign In or Register to comment.