We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    On my website, I use Highslide JS for my news images. Of course, without the CSS styling, the hidden div for the description appears in the RSS feed, which doesn’t look good. wink

    Is there any way to apply some CSS styling before it gets passed off to the user?
      My Snippets
      -> PopUpChunk v1.0
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Your regular css file can style whatever the javascript loads up, so just hide the div class or id in your css file.
        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
        • 28033
        • 925 Posts
        Quote from: sottwell at Jul 28, 2008, 09:51 AM

        Your regular css file can style whatever the javascript loads up, so just hide the div class or id in your css file.

        I didn’t know where to put the link to it, though, since you have to use a blank template for the RSS feed w/ Ditto, and having CSS at the top of it gave errors.
          My Snippets
          -> PopUpChunk v1.0
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ah you mean on an outgoing feed. No, I have no ideas on that.
            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
            • 28033
            • 925 Posts
            Hmm, I thought of an idea, although I dunno if it would work...

            Could I run some if commands in the RSS .php for Ditto, before it goes to output? For instance, I have a div wrapped around the game/section banner, as...

            <div class="n-banwrap">

            ...is there a way to check if that exists, and change it to...

            <!--- <div class="n-banwrap">

            ...before Ditto outputs the content? I’ve used pregreplace before, but I don’t think it’ll work here.
              My Snippets
              -> PopUpChunk v1.0
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You could use a plugin to remove those altogether for the feed, onBeforeWebPageRender (or whatever that final event is called). No code hacking needed!
                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
                • 7231
                • 4,205 Posts
                I don’t normally include styling in feeds and just leave that to the feed readers. Why are you including the navigation in your feed?

                You can use custom tpl for the feed output and only include the items you want to post.
                  [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]
                  • 28033
                  • 925 Posts
                  Quote from: dev_cw at Jul 30, 2008, 06:07 AM

                  I don’t normally include styling in feeds and just leave that to the feed readers. Why are you including the navigation in your feed?

                  You can use custom tpl for the feed output and only include the items you want to post.

                  See, [*content*], for some news posts, uses Highslide JS. And normally, the <div> that’s use for the caption is hidden by CSS. But that doesn’t work with RSS feeds, since I can’t seem to get CSS styling applied to the content in the feed --- only the items in it (description, etc.).

                  http://symphonicheaven.com/rss/tales/vesperia/game

                  That’s an example of it.

                  Quote from: sottwell at Jul 30, 2008, 12:22 AM

                  You could use a plugin to remove those altogether for the feed, onBeforeWebPageRender (or whatever that final event is called). No code hacking needed!

                  Do know of an example I could look at to use that?
                    My Snippets
                    -> PopUpChunk v1.0
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    There are quite a lot of search-and-replace plugins in the Repository; any one of them should be a good outline of how to search for given strings and replace them (in your case simply remove them). Of course, you would need to do a check for the document’s content-type and only do the removal if it’s an rss page being generated.

                    Here’s an excellent example http://www.modxcms.com/ChunkReplace-837.html
                      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
                      • 28033
                      • 925 Posts
                      Quote from: sottwell at Jul 30, 2008, 07:31 AM

                      There are quite a lot of search-and-replace plugins in the Repository; any one of them should be a good outline of how to search for given strings and replace them (in your case simply remove them). Of course, you would need to do a check for the document’s content-type and only do the removal if it’s an rss page being generated.

                      Here’s an excellent example http://www.modxcms.com/ChunkReplace-837.html

                      Would wrapping it in something like this work (pardon if I messed up the syntax of it)?

                      if $modx->documentObject['contentType'] = text/xml {
                      ...
                      }


                      (I don’t know much PHP, so that’s probably bad code. tongue)
                        My Snippets
                        -> PopUpChunk v1.0