We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38226
    • 18 Posts
    Hello

    I'm having trouble getting the date and author to show up on my blog post. The date and author comes through fine in the excerpt on the blog page.

    Thank you for the help!
    Jules

    Ditto Call in blog template - Works fine
     [!Ditto? &parents=`26` &extenders=`summary` &tpl=`blog-excerpt` &sortBy=`pub_date` &sortDir=`ASC` &display=`10` &truncLen=`400` &truncOffset=`20` &truncText=`Continue Reading` &dateSource=`pub_date` &dateFormat=`%B %e, %Y`!]



    blog-excerpt Chunk - Works fine
    <h2><a href="[~[+id+]~]" title="[+longtitle+]" data-disqus-identifier="post_identifier">[+longtitle+]</a></h2> 
     
    <div class="post-details">                                    
        <span>Published  [+date+]</span> <span>by [+author+]</span>
    </div>
        
    <div class="post-summary"> 
    
          <div class="blog_img"><img src="[+blog-img+]" alt="[+blog-img-alt+]" /></div>      
                          
           [+summary+]          
    
    	[+link+]
        
    </div><!-- /post-summary -->



    Blog post - Not bringing in date or author. I know [+ is for placeholder tags but I've tried [* and it's not working either. What am I missing? everything else is coming in fine.
    <div class="post">
        <h1 id="post-title">[*longtitle*]</h1>
        <h2 id="post-desc">[*description*]</h2>
        
        <div class="post-details">                                    
            <span>Published  [+date+]</span> <span>by [+author+]</span>                                 
        </div>
        
        <div class="blog_img"><img src="[*blog-img*]" alt="[*blog-img-alt*]" /></div> 
    
         [*content*]                                                            
         
    </div>

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The blog page is not coming from Ditto, so the placeholders aren't available (those are set by Ditto). You'll need to use something like http://modx.com/extras/package/authortimestamp to nicely format the article's resource date and author information. Any TVs such as the image TV are fine as they are.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 38226
        • 18 Posts
        HI sottwell

        Thanks for the help.

        I've installed the snippet and am having a little trouble.

        I don't understand the &tpl=`Post...? Wouldn't this work like Ditto's where it would call the template "Post"? &tpl=`Post` I did tried using this, but that didn't work. I also set up a template chunck for my html and called that, but didn't have any luck. I'm sure whatever I'm missing is probably obvious, just can't seem to "get it"

        //  Example call they gave.
        [[AuthorTime? &dateFormat=`%d %B %Y - %H:%M` &usedDate=`pub_date` &tpl=`Post? par <strong>[+Author+]</strong> le [+Date+]`]]


        // I also tried this call 
        [[AuthorTime? &dateFormat=`%B %e, %Y` &usedDate=`pub_date` &tpl=`blog-authorTime`]]
        
        // Template Chunk (is date and Author suppose to be capitalized? I tried it both ways.)
        <span>Published  [+Date+]</span> <span>by [+Author+]</span>


        Thank you for your support!
        Jules
          • 38226
          • 18 Posts
          I was able to get AuthorTime to work as long as I didn't call the template &tpl=`blog-authorTime`

          Still don't understand their &tpl=`Post? par....

          // basic call that worked. I'd rather use my own custom text and html in a chunk, is their no way to do this?
          [[AuthorTime? &dateFormat=`%B %e, %Y` &usedDate=`pub_date`]]


          Any suggestions?
          thanks, jules
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The tpl is not a chunk, it's the actual tpl code in the snippet parameter. The ? is a character set mismatch and should be a an accented e - Posté (French for Posted). Just put the HTML you want in the snippet parameter.

            [[AuthorTime? &dateFormat=`%d %B %Y - %H:%M` &usedDate=`pub_date` &tpl=`Posted by <strong>[+Author+]</strong> on [+Date+]`]]


            This is an old snippet, and in the snippet code there are a couple of references to etomite that you should change to modx. It may be old, but it still works just fine.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 38226
              • 18 Posts
              Thank you, that makes a lot more sense now:)

              I pasted your example without any modifications and though the text "Posted by.. " came through the Author and Date fields didn't. Not sure what that could be, do you have any ideas?

              thank you for your time!
              Jules