We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12584
    • 208 Posts
    @ sinbad

    To make links appear in new window like target="_blank"

    In newsparserx.inc.php on line 401 you have this:

    $this->output .= "<a class='rssItemLink' href='" . $this->item["link"];



    Replace with this

    $this->output .= "<a class='rssItemLink'  target=\"_blank\" href='" . $this->item["link"];


    Cheers
      • 27305
      • 173 Posts
      I want to have two feeds on my homepage one with description and one without, is that possible?

      Can I pass it via the call, I don’t have a clue what all the weird stuff is [[NewsParserX? &url=`http://modxcms.com/forums/index.php|xq|sa|xe|recent;type|xe|rss2;action|xe|.xml|xa|limit|xe|20`]]

      my feed does not have index.php its just /feed/

      Any help would be great
        I made my first site with modx
        ------------------------
        Shopping blog
        Sky+ HD
        • 19257
        • 141 Posts
        @simonok: You can hide the RSS Channel name/Title by using the following css:
        .rssChannel {display:none}
        


        I have a question though, my feed was working just fine, I was getting a feed from google news - until I used the
        TagCloud snippet
        http://modxcms.com/TagCloud-749.html
        in the same page. Now my feed doesn’t show up, even if I remove the tagcloud snippet. All it shows now is,
        An XML error occurred on line 14: > required
          • 19257
          • 141 Posts
          Sorry everyone, I fixed the problem.

          It seemed like the snippet was the problem, but the google rss feed was giving me problems. I used the Yahoo news rss feed and now it works tremendously. Thanks anyways. grin
            • 8784
            • 32 Posts
            NewsParserX works well.

            But it has a really nasty trait:
            If the feed URL you specify is broken or the feed is down the entire page will break. A better, more graceful alternative is to display an error message where the feed should have appeared.

            Fortunately an error message is easy to implement:
            1. Remove the "or die(blah)" condition in "function _load_file()"
            2. Replace it with a simple setting of an error variable
            3. Modify "function Get_Results()" to check for the error and return a simple message if an error is present.

            PHP file attached. Happy Modxing!
              • 21700
              • 42 Posts
              This is a nice snippet, modified it a bit to fit just my needs smiley Thanks!

              However, I did discover: if your feed is slow loading, either because of the size or ping delay, it’s best to create a blank modx document and use AJAX to get the results. This way your whole page will load, except for the feed. When the feed is ready, the results will be displayed. I use JQuery for this. If you don’t AJAX it into your page, your page will load slower, since MODx first waits till NewsparserX is done loading and processing the feed.

              It’s quite simple really: I created a div with the id weer (so referenced as #weer in CSS and JQuery). The page I load is nr 69 (containing the NewsParserX snippet call on a blank template). In this page, you could also set extra options, such as adding a div around it, or whatever.

              the jquery code, I just want the rssItemDesc paragraphs:

              $(document).ready(function(){
              $("#weer").load("[~69~] p.rssItemDesc", function(data){
              var weer = data.filter("p.rssItemDesc");
              $("#weer").html(weer);
              });
              });

              Or, if you want it all, it’s even easier (replace the #yourdivID and MODx Pagenr with whatever you need, you’ll get it):

              $(document).ready(function(){
              $("#yourdivID").load("[~MODx pagenr~]");
              });

              The document.ready waits for the document DOM to load. More info? check JQuery.com

              Just wanted to share that grin

              Another tip: always use the WayFinderX snippet cached, will save some time loading the feed.
                • 22303 MODX Staff
                • 10,725 Posts
                Thanks for these contributions guys; feel free to create a user account on the main web site/JIRA and submit a new version of the add-on with your adaptations. This benefits everyone in the community and encourage further contribution sharing.
                  • 9994
                  • 133 Posts
                  Works pritty good. How to open a link in a blank page?
                  Can’t find it anywhere. Is it possible ? Do i need to modify the .php file ?
                    Best CMS eva!
                    • 12288
                    • 12 Posts
                    Hello! Even using very simple call I can’t get it to work. Tried with modx forum address which should work for sure but getting the error message on the blank screen:
                    Could not open a feed called: ’http://modxcms.com/forums/index.php’
                    The call is in the content area and looks like that:
                    [[NewsParserX? &url='http://modxcms.com/forums/index.php?']]


                    What could be the reason?
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Quote from: holgerx at Mar 09, 2010, 01:24 PM

                      Hello! Even using very simple call I can’t get it to work. Tried with modx forum address which should work for sure but getting the error message on the blank screen:
                      Could not open a feed called: ’http://modxcms.com/forums/index.php’
                      The call is in the content area and looks like that:
                      [[NewsParserX? &url='http://modxcms.com/forums/index.php?']]


                      What could be the reason?

                      Because there is no RSS feed at that URL?