We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25315
    • 68 Posts
    Hi guys.

    I’m following the tutorial in the revo docs on setting up a blog.

    I’m doing some things a little differently: I’m not using tags or sections. I’m trying to do things as simply as possible. I haven’t set up an archive either.

    I’ve got a couple of unexpected results so far. One is that, after creating a post, following the directions in the tutorial, the post isn’t showing up on the main blog page.
    I can find the post page by either going to a preview of it or allowing it to show up in the menu. But I don’t want it to be picked up by wayfinder, so I don’t want my posts in menus for now.

    I suspect the problem might come from my blog page template, which I’ve modified from the example in the docs to account for me not using tagging, and the blog’s resource id being different (’1’ in the tut. ’10’ in my site structure.)

    [[$chunkHead?]]
    <div id="blog-container" class="card">
    <h1>Julie Anne Genter's Blog</h1>
    [[!getResourcesTag?
      &elementClass=`modSnippet`
      &element=`getResources`
      &tpl=`blogPost`
      &parents='10'
      &limit=`5`
      &includeContent=`10`
      &includeTVs=`10`
      &showHidden=`0`
      &hideContainers=`1`
      &cache=`0`
      &pageVarKey=`page`
    ]]
    [[!+page.nav:notempty=`
    <div class="paging">  
    <ul class="pageList">  
      [[!+page.nav]]  
    </ul>  
    </div>
    `]]
    </div> <!-- blog-container ends -->
    [[$chunkFoot?]]
    


    What could be happening here?

    The other problem I’ve got is a strange behaviour in my wayfinder created menu, that seems to occur when I’m on the blog page.
    ’blog’ is a top level resource that has no parent. It has the resource ID of ’11’.
    When I’m on the blog page, the item ’blog’ appears in my simple wayfinder generated menu, as expected.
    However, if I click on it, my browser attempts to load ’http://mypage/blog/blog’.
    On all other pages, the same link seems to present the favourable URL, ’http://mypage/blog’.

    Furthermore, the navigation menu generated by the exact same wayfinder code messes up the URLs in the menus from the page of my blog post. All URLs are suffixed with ’blog’. So they all go nowhere.

    If it looks like I can’t quiet modify the tutorial instructions to work simply without tagging, is there another guide available that lets me achieve the same result? Just a blog, preferably with commenting using modx?
      • 28215
      • 4,149 Posts
      splittingred Reply #2, 16 years ago
      1. You’re using an apostrophe ’ instead of a backtick ` in your getResourcesTag call. You need to use a backtick `.

      2. Add a <base href="[[!++site_url]]" /> tag into the HEAD of your template. That will fix the URL issue.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 25315
        • 68 Posts
        Hi Shaun.

        I’ve gone through the tutorial again, setting everything up from scratch, but still not including tags and commenting.

        Editing the ’base href’ tag in the head fixed the URL issue.

        I changed the apostraphes to backticks.
        But I’m still not seeing my test posts listed on the blog page.

        my new code snippet for the blog page looks like this:
        [[$pageHeader?]]
        <div id="blog-container" class="card">
        
        [[!getResourcesTag?
          &elementClass=`modSnippet`
          &element=`getResources`
          &tpl=`blogPost`
          &parents=`16`
          &limit=`5`
          &includeContent=`1`
          &includeTVs=`1`
          &showHidden=`0`
          &hideContainers=`1`
          &cache=`0`
          &pageVarKey=`page`
        ]]
        [[!+page.nav:notempty=`
        <div class="paging">  
        <ul class="pageList">  
          [[!+page.nav]]  
        </ul>  
        </div>
        `]]
        </div> <!-- blog-container ends -->
        [[$pageFooter]]
        


        ’16’ is the id for the blog page.
        I’ve made sure that the test posts are marked as published.
          • 28215
          • 4,149 Posts
          splittingred Reply #4, 16 years ago
          Are the resources marked as "Hide from Menus", or are containers?
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 25315
            • 68 Posts
            Quote from: splittingred at Oct 05, 2010, 11:28 PM

            Are the resources marked as "Hide from Menus", or are containers?

            They are not containers.
            They are marked as hidden from menus.

            I unmarked ’hidden from menus’. This helped.
            The page now gets content.

            But the content seems to be a text snippet definition of a php array.
            It looks like this now:
            http://imgur.com/58cv4.jpg

            I’ve changed my wayfinder call, so it won’t show list the blog entries. The php code is wrapped in ’pre’ tags.

            What is causing this?
              • 9674
              • 170 Posts
              I’m having trouble with it too !

              Shaun, I left a message on twitter about it.

              If the item are not shown on the menu they don’t appear even if they are marked as published.

              I thought publish would be enougth, given the fact that with many published items on the blog my menu will look like a never ending story (have à look at the under construction site http://www.art-impulsion.com under news...)

              Is there a way to check the published status rather than the presence in the menu ?

              Thanks for help

              Best

              Philippe

                • 28215
                • 4,149 Posts
                splittingred Reply #7, 16 years ago
                Use &showHidden=`1` in the getResourcesTag call. See the docs for getResources (which getResourcesTag extends) for more info: http://rtfm.modx.com/display/addon/getResources/
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 25315
                  • 68 Posts
                  many published items on the blog my menu will look like a never ending story

                  Do you mean your navigation menu?

                  I figured out the designer of wayfinder must have thought of this possible problem, so I looked closer at the docs.
                  Turns out that with wayfinder, you can set the level resources to output to the resulting markup.

                  The property
                  &level=`1`

                  restricts the depth of wayfinders output to a single level.
                    • 9674
                    • 170 Posts
                    Shaun,

                    Thanks, I used &showHidden=`1` it worked fine, I also change the getPage in the archive landing page. grin

                    I will now focus on the design part of the site with Valérie http://www.vdgraphics.com

                    Great job again !

                    Philippe

                      • 9674
                      • 170 Posts
                      robrob,

                      Thanks for your help, but this would not work for me since I have other menu branches that need to be developped...

                      Shaun gave me the solution, see my reply above. grin


                      Thanks anyway.

                      Philippe