We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    I’m building a simple blog. I’ve created several posts to see how Ditto works - well, it works great pulling the content and summarizing it, yet when I click on the link to view the entire post it gives me an error page. Here’s my ditto call and blog template:

    [[Ditto? &startID=`44` &summarize=`3` &removeChunk=`Comments` &tpl=`BlogTpl` &paginate=`1` &extenders=`summary,dateFilter`&dateFormat=`%A %B %e, %Y` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` ]]
    
    <p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles</p>
    
    <div id="ditto_pages"> [+previous+]  [+pages+]  [+next+] </div>


    <div class="post">
    	<h2><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h2>
    	[+summary+]
            <p>[+link+]</p>
    	<div class="post_info" >Posted by <strong>[*blogAuthor*]</strong>  |  [+date+]  |  Tags: [+tagLinks+]</div>
    </div>
    


      The MODx has you...
      Utah Web Design
      • 4749
      • 623 Posts
      Sorry about the bump but I think I have some info that might help.

      in the url when clicking on a blog post summary to read the entire blog it does this:

      mysite.com/blog/post.html

      but, what’s weird is when I go to

      mysite.com/post.html

      it shows up - does that help to get a solution going?
        The MODx has you...
        Utah Web Design
        • 18397
        • 3,250 Posts
        Do you have Friendly Alias Paths enabled? Also, do you have the base url declared in the html of the page? If not, you might want to add mysite.com before the [~[+id+]~] in your code.
          • 4749
          • 623 Posts
          Mark, I don’t have Friendly Alias Paths enabled. When I click on that summary the address bar it shows this:
          mysite.com/blog/post.html
          but this is an error page - it doesn’t show the blog post.

          Like I said earlier, if I just type it directly in it shows the post. So, typing in:
          mysite.com/post.html
          the post is there. Even though it’s located in the blog folder, it doesn’t shoe the file path that way. Because logically, being inside the blog folder, wouldn’t blog/post.html make sense? Or am I just too tired? Thanks again.

          [EDIT] I’m really stumped by this one. Setting up a blog shouldn’t be this painful. When clicking on the summary to view the entire post it shouldn’t append the file name to the directory, should it? It doesn’t do that in the default installation. Arrggh! It’s going to be something so small and stupid and I’m going to feel like an idiot.
            The MODx has you...
            Utah Web Design
            • 36592
            • 970 Posts
            What is the url of your Ditto page ? Is it ’mysite.com/blog/’ ?
            If so, you should add base tag in your template head section.
            <base href="[(site_url)]"></base>
              • 4749
              • 623 Posts
              OH, thanks! That was the trick. Uh, I’m a little embarrassed to ask, but why does that matter? But, anyway thanks for the help.
                The MODx has you...
                Utah Web Design
                • 36592
                • 970 Posts
                Quote from: cbaone at May 22, 2008, 02:46 AM

                Uh, I’m a little embarrassed to ask, but why does that matter?
                That is a issue of ’relative path’.
                Suppose you are seeing ’mysite.com/blog/’ and there is a link to ’post.html’ in that page(<a href="post.html"...>),
                the browser link it to mysite.com/blog/post.html.
                When there is a base tag in the page, the browser always make a link relative to the url specified in base tag.
                So evenif you are seeing mysite.com/blog/, the browser link it to mysite.com/post.html when you set base url to ’mysite.com/’.
                  • 4749
                  • 623 Posts
                  Thanks for the explanation. It makes sense, I guess I just thought ModX had magical powers and it knew exactly what I was thinking. wink

                    The MODx has you...
                    Utah Web Design