We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13246
    • 42 Posts
    hello,

    I there a way that my modx can automatically create an rss feed of all my pages including the titles and links?

    I have tryed this yet but it doesn’t work:
    [!Ditto? &format=`rss` &tpl=`ditto_rss_tpl`!]

    now I get an empty page.

    Ivar

    PS. I do not use Ditto any further on my site.
      • 36624
      • 535 Posts
      hi,
      the wiki is your friend : http://wiki.modxcms.com/index.php/Basic_RSS_feed
        CTRL+SHIFT+U - Clear Cache
        CTRL+SHIFT+H - Hiding Heft Panel
        CTRL+SHIFT+N - Fast Create Resource
        CTRL+ALT+P - Preview Recource (in edit resorce window)
        CTRL+ALT+S - Save
        • 33337
        • 3,975 Posts
        You need to define &parents parameter. The id of the container in which all posts/articles resides. i.e. &parents=`2` OR for multiple &parents=`23,24,25`.

        hope this helps.
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 13246
          • 42 Posts
          I want all my pages to be included!

          how can I do this?

          edit: maybe it’s possible with wayfinder? and a pair of chunks.
            • 14050
            • 788 Posts
            All pages would be &parents=`0` &depth=`0`

            Ditto is definitely the way to go. You can find documentation for it at http://ditto.modxcms.com

            Here is an example RSS feed using it:

            http://ditto.modxcms.com/tutorials/custom-rss-feed.html

            Ditto allows your template to contain any placeholder for which there is a content field when creating a page and any TVs you have created.

            [+pagetitle+], [+longtitle+], [+description+], [+introtext+], [+content+], [+myTV+], [+etc+]
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 13246
              • 42 Posts
              it nearly works

              when I look in my source now the data is there but on the page (FF standard rss parser) there is noting huh

              edit: http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fsteunpunt.nexethosting.com%2Ffeed why isn’t it good? how can I fix it?
                • 36624
                • 535 Posts
                <copyright><! [CDATA[

                should be :

                <copyright><![CDATA[
                  CTRL+SHIFT+U - Clear Cache
                  CTRL+SHIFT+H - Hiding Heft Panel
                  CTRL+SHIFT+N - Fast Create Resource
                  CTRL+ALT+P - Preview Recource (in edit resorce window)
                  CTRL+ALT+S - Save
                  • 13246
                  • 42 Posts
                  now I get error’s because of the javascript and the style in my pages.

                  is there a way to ’strip’ the content of the pages from those chunk before it is put in my rss.
                  those chunk must be in place when the page is loaded normally.

                  edit: is there also an way to exclude some docs because of that they aren’t shown in the menu?
                    • 36624
                    • 535 Posts
                    i think you should extract your chunk from the description field (content in modx? ) and use a tv for this chunk so you dont have styles ans js in the <description>..

                    for excluding doc you can use that : http://ditto.modxcms.com/tutorials/basic_filtering.html

                    and you can find the shown in menu here : http://modxcms.com/the-document-object.html

                    good luck
                      CTRL+SHIFT+U - Clear Cache
                      CTRL+SHIFT+H - Hiding Heft Panel
                      CTRL+SHIFT+N - Fast Create Resource
                      CTRL+ALT+P - Preview Recource (in edit resorce window)
                      CTRL+ALT+S - Save
                      • 13246
                      • 42 Posts
                      I have a filter script now.

                      how do I make it work with the ditto.
                      <?php
                      $tekst = 'ga naar <a href="http://www.vintagesworld.be">mijn site</a> andere test [!hallo!] [[world]]. hier tussen <style type="text/css">#aap {beer: muis;}</style> staat een style en een script.';
                      
                      $tekst =  preg_replace("#\<style(.*?)\<\/style\>#i","", $tekst); //alle styles
                      $tekst =  preg_replace("#\<script(.*?)\<\/script\>#i","", $tekst); //alle scripts
                      
                      $tekst =  preg_replace("#\[(.*?)\]#i","", $tekst); //haalt alles tussen [ en ] weg incl de []
                      $tekst =  preg_replace("#\<(.*?)\>#i","", $tekst); //haalt alles tussen < en > weg incl <>
                      $tekst =  preg_replace("#\]#i","", $tekst); //haalt laatse achtergebleven ] weg
                      
                      echo $tekst;
                      ?>