We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11678
    • 160 Posts
    When I create a blog template by copying from the tut, only changing the head and foot,
    I get the following error when I try to open the page;

    Fatal error: Call to undefined method modX::escape() in C:\xampp\htdocs\core\cache\elements\modsnippet\12.include.cache.php on line 244

    What could be causing this error?
      "Today’s headlines are nothing more than whispers of history"
      • 11678
      • 160 Posts
      Never mind.
        "Today’s headlines are nothing more than whispers of history"
        • 11678
        • 160 Posts
        I finally got the BlogPostTemplate working, but only after a long time trouble-shooting problems.
        The code in the tutorial, only worked with calls to MODx tags as;
        <h2 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>

        but nowhere else. I was getting blank post pages. For grins I changed the + to * in all the calls;
         <h2 class="title">[[*pagetitle]]</h2>

        and BINGO! Everything now worked! I don’t understand why, it just works. So I have 2 chunks, one called "blogPost" as shown in the tutorial that only displays the introtext, and one I call "blogPostFull" called only by new comment pages via BlogPostTemplate that shows the entire post.
        This is how my customized post now displays when called by the blog home page via "Read more" and by clicking on "New Posts" in the sidebar ;

        <!-- blogPostFull; 18 APR 2011 -->
           
        <div class="dateBox">
        
            <div class="smallCalendar">
                <div class="dateMonth">[[*publishedon:strtotime:date=`%b`]]</div>
                <div class="dateDay">[[*publishedon:strtotime:date=`%d`]]</div>
                <div class="dateYear">[[*publishedon:strtotime:date=`%Y`]]</div>
            </div>
        </div>	
        
            <h2 class="title">[[*pagetitle]]</h2>
        			
        <div class="post-body">
             [[*content]]
        </div> 	
        <div class="post-footer">
                    <p class="postmeta">               
                    <a href="[[~[[*id]]]]#comments" class="comments">
                    Comments ([[!QuipCount? &thread=`blog-post-[[*id]]`]])</a>|
                    Tags: [[*tags:notempty=`[[!tolinks? &items=`[[*tags]]` &key=`tag` &target=`2`]]`]]           
                    </p>	
                </div> <!-- end of post-footer -->
        		
        	

          "Today’s headlines are nothing more than whispers of history"
          • 7391
          • 49 Posts
          This might help someone in the future:

          I just spend about 2days trying to figure out why i couldn’t get my blog home to display anything. after i double checked everything and went through almost every blog related post on this site.. I finally decided to just start over. So of-course the first thing to do is install all the packages. So i un-installed them first and reinstalled all again..

          Just as i was about to remove all the chunks and other resources i said "let me see wt that did".. and PRESTO.. everything was perfect all of a sudden smiley

          May be because i just updated to the latest version of Revo.


            • 37165
            • 89 Posts
            Hi I was able to get my blog working with this tutorial. Being new to modx, I am having one little problem that is driving me crazy because it seems like and easy thing to implement, but I can not get it working.

            I have a tag system set up. The links all work. For example lets say the user clicks on a tag called "babies". The result is a page listing of all posts tagged "babies". Great, but I want to create an <h2> tag at the top of the page that also says "babies" so the user knows what the query was. How do I do this?

            this is what the end of my urls look like:/tag-and-archive-page/?tag=babies&key=tags

            tag-and-archive-page is my target that is set up like the tutorial. How can I have this page dynamically print the quired tag at the top of the page in an H2 tag?
              • 37165
              • 89 Posts
              got the answer from Charless here is is if anyone wants it

              harless Reply #2, 13 min ago

              Un-mark As SolutionReply
              You could create a very simple snippet that would simply output the tag value when the key/value pair for tags is present in the query string.

              Vary basic snippet (ex snippet name: dyntagtitle):
              //-- Get all request string key/value pairs
              $s = $_REQUEST;
               
               
               
              if($s['key'] == 'tags'){
                return $s['tag'];
              } else {
               return false;
              }
              


              Then on the page template simply put the snippet call where you want it to be displayed:

              [[!dyntagtitle]]
              



              cheers
                • 39501
                • 163 Posts
                Just to let you know that the dyntagtitle snippet no longer works in the latest version of Revolution. Damit!