We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22446
    • 181 Posts
    I upgraded to Modx 2.02 and now I have an issue with my getResource output. The page displaying the getResource call out is now showing all the HTML tags, (eg. <p>, <div>, <img>, etc.) Does anyone know how to correct this? My code for the getResource is displayed below.

    getResources Call out
    [[!getResources? &parents=`115,28` &limit=`1` &includeContent=`1` &sortby=`publishedon` &showHidden=`1` &includeTVs=`1` &tvPrefix=`` &tpl=`hp_latest_news_left`]]


    Chunk template
    <p>[[+Article_Caption_Image]]</p>
    <h2><a href="/[[~[[+id]]]]">[[+pagetitle]]</a></h2>
    <div>[[+introtext:default=`[[+content:ellipsis=`300`]]`]]<br /><a href="/[[~[[+id]]]]">Read more »</a></div>


    I have no idea what is wrong. It was working fine prior to updating modx.
    • Why would upgrading make it show HTML tags? Have you validated the page to see what is wrong?
        • 22446
        • 181 Posts
        I am unsure why.

        Here is a page that I have. I ran a validation on the page and it appears that there is an issue with the simple search, but I don’t believe this is where the problem is.

        http://www.outdoorsadv.com/fishing/articles.html

        Again Chunk for the page above:
        <div style="overflow:hidden;">
        <div class="article_sum_img">[[+Article_Caption_Image]]</div>
        <div class="article_sum_text">
        <h2><a href="/[[~[[+id]]]]">[[+pagetitle]]</a></h2>
        <h5 style="margin:0px 0px 0px 0px; color:#808080; font-weight:normal;">[[+Published_Date]] [[+Author]]</h5>
        <p>[[+introtext:default=`[[+content:ellipsis=`500`]]`]]  <a href="/[[~[[+id]]]]">Read more »</a></p></div></div>
        <div class="article_summary_divider"><img src="/website/images/div_line.gif" alt="" /></div>


        Call Out for the page above
        [[!getResources? &parents=`28` &limit=`10` &tpl=`Articles` &includeContent=`1` &sortby=`publishedon` &showHidden=`1` &includeTVs=`1` &tvPrefix=`` &hideContainers=`1`]]


        Check the validation for yourself, and you will see the only validation error is in the simple search form snippet.
          • 22446
          • 181 Posts
          I was able to get the validation fixed on the http://www.outdoorsadv.com/fishing/articles.html page, but I still have the getResources showing the HTML tags on the page. Any suggestions?
          • Your use of the ellipsis filter is the problem; it is not smart enough to keep from breaking HTML tags.
              • 22446
              • 181 Posts
              Okay, removing ellipsis solved the problem, now the entire article outputs. Do you have any suggestions to an alternative output filter to show only a summary of the article?
                • 22446
                • 181 Posts
                Any help would be much appreciated. I need to get my site back and running without the HTML tags.

                Why before I upgraded to modx 2.0.2 the getResources with ellipsis worked and now there are issues? I have changed nothing since the upgrade.
                • Quote from: outdoorsadv at Sep 22, 2010, 01:54 PM

                  Any help would be much appreciated. I need to get my site back and running without the HTML tags.

                  Why before I upgraded to modx 2.0.2 the getResources with ellipsis worked and now there are issues? I have changed nothing since the upgrade.
                  Have no idea how it would be related to the upgrade (unless you had stuff cached that had changed since). You can strip the HTML and MODx tags from the content and try using that, but TBH, there is no simple/easy way to turn your entire content into valid HTML when you take x number of characters of it. You will need a filter that can reformat the content in some way (i.e. can auto-close any open tags in the first x characters). IMO, it’s much easier and more efficient to make sure you have an introtext for any Resources you are aggregating.
                    • 22446
                    • 181 Posts
                    So I was searching around the modx website, and I see that the modx website is having the same issues I was having on my website. Check out this link.

                    http://modxcms.com/extras/search.html?query=getResources

                    The HTML tags are output with the summary of the extras.
                    • The ellipsis filter was broken in 2.0.2. Please see this thread:

                      http://modxcms.com/forums/index.php/topic,54578.msg316336.html#msg316336