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

    I have Revo 2.2 with Articles. I have copied the sample.ArticleRowTpl and called it CustomArticleRowTpl this essentially then outputs another chunk that does post layout called FormatPost which I have used elsewhere in the site for this type of layout.

    Format post has a few variables: title, date, posted, postHtml
    In certain circumstances postHtmlwill not work, see example below:

    CustomArticleRowTpl
    [[$FormatPost? &title=`<a href="[[~[[+id]]]]">[[+pagetitle]]</a>` 
    &date=`[[+publishedon:strtotime:date=`%b %d, %Y`]]` 
    &posted=`[[%articles.posted_by]] <a href="[[~[[*id]]]]author/[[+createdby:userinfo=`username`]]">[[+createdby:userinfo=`username`]]</a>` 
    &postHtml=`
    	  <p>[[+introtext:default=`[[+content:ellipsis=`200`]]`]]</p>
    	  <p class="links">
    	    <a href="[[~[[+id]]]]" class="readmore">[[%articles.read_more]]</a>
    	    [[+comments_enabled:is=`1`:then=`| <a href="[[~[[+id]]]]#comments" class="comments">[[%articles.comments]] ([[!QuipCount? &thread=`article-b[[+articles_container]]-[[+id]]`]])</a>`]] | 
    	    [[+tv.articlestags:notempty=` | <span class="tags">[[%articles.tags]]: [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1`]]</span>`]]
    	   </p>
    `]]


    FormatPost
    <div class="post">
    	[[+title:notempty=`<h2 class="title">[[+title]]</h2>
    	<p class="meta"><span class="date">[[+date]]</span><span class="posted">[[+posted]]</span></p>`]]
    	<div class="entry">
    		[[+postHtml]]
            </div>
    </div>


    It doesn't output anything to the postHtml variable unless I remove these lines from the CustomArticleRowTpl

    	    [[+comments_enabled:is=`1`:then=`| <a href="[[~[[+id]]]]#comments" class="comments">[[%articles.comments]] ([[!QuipCount? &thread=`article-b[[+articles_container]]-[[+id]]`]])</a>`]] | 
    	    [[+tv.articlestags:notempty=` | <span class="tags">[[%articles.tags]]: [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1`]]</span>`]]


    OR I remove the FormatPost call and do the layout all in CustomArticleRowTpl but that then means if the post html formatting changes I have to change it in multiple places which isn't desired...other places in the site use FormatPost which wouldn't be able to use CustomArticleRowTpl

    I have no idea if I'm doing something wrong - if this is a limitation. It's confused me completely.

    Thanks for your help
    Danny
      • 34084 ☆ A M B ☆
      • 756 Posts
      In your postHTML parameter you have:

      &postHtml=`
            <p>[[+introtext:default=`[[+content:ellipsis=`200`]]`]]</p>
            <p class="links">
              <a href="[[~[[+id]]]]" class="readmore">[[%articles.read_more]]</a>
              [[+comments_enabled:is=`1`:then=`| <a href="[[~[[+id]]]]#comments" class="comments">[[%articles.comments]] ([[!QuipCount? &thread=`article-b[[+articles_container]]-[[+id]]`]])</a>`]] | 
              [[+tv.articlestags:notempty=` | <span class="tags">[[%articles.tags]]: [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1`]]</span>`]]
             </p>
      `


      When you nested properties/parameter holders using the tick mark " ` " you have to escape them properly to parse correctly with double tick marks " `` ".

      sorry - bad bad bad me [ed. note: charless last edited this post 14 years, 9 months ago.]
        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
        Visit CharlesMx.com for latest news and status updates.
        • 6511
        • 60 Posts
        I didn't think you needed to escape them on Revolution?
          • 34084 ☆ A M B ☆
          • 756 Posts
          crap, sorry about that - your correct they should not be needed.
            Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
            Visit CharlesMx.com for latest news and status updates.
            • 6511
            • 60 Posts
            Anybody got any ideas on this one... It has me completely stumped?