We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37059
    • 368 Posts
    Archivist 1.0.1 isn’t working at all for me. Copied snippet call and template page directly from the docs.

    Snippet call:

    
    <ul>
    [[!Archivist? 
        &parents=`11`
        &target=`26`
        ]]
    </ul>
    



    Resource 11 contains 3 published blog posts, which are picked up fine by getResources in another call.

    Target page (26) code:

    
    [[!getArchives?
       &parents=`11`
       &toPlaceholder=`archives`
    &showHidden=`1`
    ]]
     
    <h2>[[+arc_month_name]] [[+arc_year]] Archives</h2>
     
    [[+archives]]
    



    The Archivist call returns 1 month, January - as it should, but the link to January’s posts seems to be missing a slash: "http://server/site/blog-archives2011/01" - worse, even when I replace the slash ("http://server/site/blog-archives/2011/01") the page doesn’t load, instead pausing for a couple of minutes, then loading a mangled version of the site’s homepage. I have tried clearing the cache, to see if that would trigger anything.

    MODx 2.0.7-pl installed in subfolder of webroot, Debian, PHP 5.3.3-7, MySQL 5.1.49, pdo_mysql installed, Safari/Firefox/Chrome, no opcode caching to my knowledge.
      Jason
      • 5160
      • 118 Posts
      I have a similar issue. Archivist will correctly list the months and number of resources in each but the link is missing the forward slash:
      mywebsite.co.uk/archives.html2011/02

      adding the forward slash manually throws the default ’resource not found’ message:
      mydraftwebsite.co.uk/archives.html/2011/02

      This is on a fresh install of MODx Revolution 2.0.7-pl (traditional), Windows Server 2008 with several other Revolution 2 sites running without issue, although none make use of Archivist.

      @kenquad - did you find a resolution?

      Unsure why my link has archives.html in but will keep investigating.
        • 37059
        • 368 Posts
        Quote from: chris.dempsey78 at Feb 10, 2011, 11:33 AM

        @kenquad - did you find a resolution?

        No resolution here. Glad to see it’s not just me! wink

        I think it must be a bug or an incompatibility with 2.0.7. If you agree, why don’t you file it here since you have a cleaner test case than I do.
          Jason
          • 5160
          • 118 Posts
          Actually, I think I might have it sorted. I changed my Archives resouce to be a container which gets rid of the .html extension and the system now appears to work as it should. It’s all wireframe with nonsense test posts so it’s not easy to tell at first glance but it looks fine now.

          I did change the Archives resource to be a container before making my original post and it looks like a combination of coffee/redbull/phonecalls made me do so incorrectly or fail to recognise it was actually working and set it back to being a regular resource.

          Dunno if that helps you directly but let me know if you want me to post any of my code for comparison with your own.
            • 37059
            • 368 Posts
            Quote from: chris.dempsey78 at Feb 10, 2011, 11:47 AM

            I changed my Archives resouce to be a container which gets rid of the .html extension and the system now appears to work as it should.

            You’re my hero grin

            Maybe it should be obvious that the archives resource needs to be a container, but it never occurred to me. Seems to me it merits at least a mention in the docs.

            Everything’s working now.
              Jason
              • 5160
              • 118 Posts
              Nice one. It did cross my mind earlier in the day but the tutorial http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution#CreatingaBloginMODxRevolution-CreatingtheArchivesResource doesn’t mention the Container requirement.

              Creating the Archives Resource

              Go ahead and place a Resource in your root called ’Archives’, and give it an alias of ’archives’. Then inside the content...


              Learning is good though.
                • 37059
                • 368 Posts
                Learning is good. Documentation is better wink
                  Jason
                  • 23510
                  • 168 Posts
                  Another thing is that the Archives folder *must* be in the root. It can’t work if it is inside another folder.
                    • 37210
                    • 131 Posts
                    ALSO! If you don’t have Friendly URLs on, don’t forget to add to your Archivist call. I was having the same issues as people in this post, but even after I turned the archive resource into a container, I was still getting index.php?id=3772010/01 in my URL and it just didn’t look right.

                    I have the Archivist call on resource ’22’ and the GetArchive snippet on resource ’377’, so mine looks like:

                    On resource 22:
                    [[!Archivist? &parents=`22` &useFurls=`0` &target=`377`]]


                    On resource 377:
                    [[!getArchives? &parents=`22` &toPlaceholder=`results`]]
                    Search Results
                    
                    [[!+results]]


                    Now the URL looks like this index.php?id=377&arc_year=2010&arc_month=01 and it works!