We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32614
    • 65 Posts
    i am trying to accomplish something similar to what many sites have (such as theonion.com, bottom left of the page) where there is a little div with an <ul> in it featuring the text headlines from cnn.com or whatever.

    from what i can tell, the way to do this is with one of the following snippets: NewsParserX, feedreader, or xslt.

    so far, i’ve tried all three with no success. i should warn you that despite having made many sites in modx, i am still a total and complete newb, and i don’t understand even the most basic things. so please, i beg you to talk down to me.

    i want the results from the snippet to be formatted as a <ul> so that it can be styled nicely, and i’d like to be able to define how many headlines show up. other than that, i don’t think i need anything too fancy. it should look a lot like the one i mentioned on the onion’s site.

    the url i’m trying to pull news from is this one, tho i doubt that really enters into it:
    http://pewforum.org/rssfeeds/news/world/rss.xml

    i’m using the latest version of modx, and the site is hosted by godaddy using whatever kind of servers they use (i’m not sure).

    i’ve had great luck on the forums lately, so i’m hoping i can get this knocked out too (not to be too greedy).

    thanks!
      "A great democracy must be progressive, or soon it shall cease to be great, and soon it shall cease to be a democracy." -Theodore Roosevelt
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, using your URL, NewsParserX works fine. It uses a <div class="rssChannel"> with nested p and a tags instead of an unordered list, but that can easily be styled however you like.

      http://www.sottwell.com/

      The chunk used for the snippet call:
      <div id="newsfeed">
      [!NewsParserX? &url=`http://pewforum.org/rssfeeds/news/world/rss.xml` &limit=`3`!]
      </div>

      The CSS:
      #newsfeed{
          margin:20px 10px;
          border:1px solid #000000;
          padding:5px;
      }
      #newsfeed .rssChannel{
          margin:5px 5px 10px 5px;
      }
      #newsfeed .rssChannel .rssChannelLink{
          margin:5px;
          color: #688c43;
          text-decoration:none;
          border:none;
      }
      #newsfeed .rssItemTitle .rssItemLink{
          display:block;
          font-size:0.9em;
          color:darkgreen;
          text-decoration:none;
          border-bottom:1px solid darkgreen;
          margin-bottom:1em;
      }
      
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 32614
        • 65 Posts
        thanks so much for your continued help sottwell!

        i think i can get this to work, i’ll miss my little bulletpoints i had in my <ul> but i think it will be fine.

        i am having trouble getting rollover styles to work. i’m adding this to my css:

        .rssItemLink a:hover, .rssItemLink a:hover {
        	color:#e67637;
        	text-decoration:none;
        }
        .rssChannel a:hover, .rssChannelLink a:hover {
        	color:#e67637;
        	text-decoration:none;
        }


        the non-hover color is #6d3b10, so this seemed like it would style it for me... but it’s not. whatever, i’m sure i’ll figure this out.

        what i’m really wondering is if there’s anyway to not have the
        PewForum.org | Religion & World Affairs Channel
        link in there at the top of the rss div? i looked around in the snippet and of course in the chunk you kindly supplied me, but i didn’t see any obvious way to make that go away.

        thanks again!
          "A great democracy must be progressive, or soon it shall cease to be great, and soon it shall cease to be a democracy." -Theodore Roosevelt
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          So make a little "bulletpoint" image, and use it as the background of each <a> or one of the other line-item tags, with a bit of left padding to move the text over.

          You can, if you are really set on an unordered list, modify the newsparser.inc.php file to use <li> tags instead of the line-item <div> tags. Ditto and Wayfinder have extracted the output into placeholders and made it possible to use chunk templates for the desired HTML framework for the data; this snippet still hard-codes the HTML.

          The display code is in a function that starts in line 344. You would need to put the enclosing <ul> tags in your chunk, and have the function generate <li> tags instead of <div> tags.

          You could hide the .rssChannel div in the CSS with a display:none
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 32614
            • 65 Posts
            thanks so much!

            i wasn’t able to figure out the whole thing where i change it to be a <ul> but i was able to sufficiantly style the <div> and <p> method, so it’s fine. and i got my rollover link text to work and the title of the rss hidden and everything! it’s looking great! thanks so much.

            the site is coming along now so well. hopefully i won’t have too many more questions to trouble you with.

            thanks again, sottwell! [fixed!]
              "A great democracy must be progressive, or soon it shall cease to be great, and soon it shall cease to be a democracy." -Theodore Roosevelt
              • 7231
              • 4,205 Posts
              wompedy: Good to hear that you are progressing with your project.

              BTW - it is sottwell, no c, check out the avatar and you will understand grin
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                That’s OK, my eyes are getting so bad that most of the time I can’t even see clearly enough to notice it. Just glad I can still be of a little help now and then.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org