We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1169
    • 312 Posts
    Has anyone seen anything like this before?

    Revo 2.1pl

    I was following the tutorial http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

    I have converted a blog HTML5 template to MODX and it works with no MODX content.

    I removed the blog content section and replaced with [[*content]].

    I added the following code from Setting up Your Blog Home changing the &parents
    [[!getResourcesTag?
      &elementClass=`modSnippet`
      &element=`getResources`
      &tpl=`blogPost`
      &parents=`2,3,4`
      &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>
    `]]


    With the following tpl
    <div class="post">
        <h2 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
        <p class="post-info">Posted by [[+createdby:userinfo=`fullname`]]
     [[+tv.tags:notempty=` | <span class="tags">Tags: 
    [[!tolinks? &items=`[[+tv.tags]]` &key=`tag` &target=`1`]]
    </span>`]]</p>
        <div class="entry">
        <p>[[+introtext]]</p>
        </div>
        <p class="postmeta">
          <span class="links">
    <a href="[[~[[+id]]]]" class="readmore">Read more</a>
    | <a href="[[~[[+id]]]]#comments" class="comments">
        Comments ([[!QuipCount? &thread=`blog-post-[[+id]]`]])
      </a>
    | <span class="date">[[+publishedon:strtotime:date=`%b %d, %Y`]]</span>
          </span>
        </p>
    </div>




    This results in part of the Template Code disappearing. This happens halfway into the head section in a meta description line after ’content=’ including my css js modernizer and header and navigation sections up until the [[*conten]] call. I tried commenting out the meta line but lost more content from the getReaourvesTag call this was commented out, not vanished like template code.

    Everything works without the snippet code in Resource in question Home Page ID 1.

    Any ideas huh

    EDIT

    I found the problem by deleting the offending line as this was trying to use the snippet as the Description.

    Moral of story don’t try working too late at night.
      DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Sounds like your html is invalid to me? Did you try running it through a validator to see if you’re missing some quotes? Does anything appear in your source code?

      If the above doesn’t help - can you show the rest of the template?


      Edit: Ah, see you just marked it as solved laugh Working late at night is for the real pros wink
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 1169
        • 312 Posts
        The HTML was valid before I added the Snippet code.

        We must have posted at the same time I edited my first post with solution.
        See first post.

        You were also right it ended up a mess as it was then pulling in snippet code.
        Offending line
        <meta name="description" content="[[*introtext:empty=`[[*content:strip_tags:strip]]`:limit=`200`]]" />


        Thanks Mark H
          DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31