We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24904
    • 79 Posts
    Hi
    I’m using ditto for the "news" page

    The item shows up correctly but the PAGE URL does not.
    i.e Show as "mynewspage here" then it links to http://www.mydomain.com/modx/news/38.html

    Where 38.html; the number 38 is the document id #.

    Is there a way I could make it use the document alias instead of the document id #?
      • 4310
      • 2,310 Posts
      If you have FURL enabled and use something like this in your Ditto template :
      <a href="[~[+id+]~]" >[+pagetitle+]</a>

      It will produce a link converted to your alias, assuming you have an alias filled in, if you don’t you usually get the doc id .html!
        • 24904
        • 79 Posts
        thanks

        how would I make the data format
        13-Oct-08 16:33

        without the time?
          • 33982 ☆ A M B ☆
          • 476 Posts
          how would I make the data format
          13-Oct-08 16:33
          
          without the time?

          Just Google "php timestamp" ... there are so many ways you can vary the output of the date.  Here’s one I just used on one of my sites which outputs: "Posted September 30, 2008" ... the code is below:

          Posted [+createdon:date=`%B %d, %Y`+]
            Precision Web Development ... SmashStack.com
            • 33337
            • 3,975 Posts
            Zaigham (aka zi) Reply #5, 18 years ago
            Quote from: flinx at Oct 12, 2008, 11:23 PM

            how would I make the data format
            13-Oct-08 16:33
            
            without the time?

            Just Google "php timestamp" ... there are so many ways you can vary the output of the date. Here’s one I just used on one of my sites which outputs: "Posted September 30, 2008" ... the code is below:

            Posted [+createdon:date=`%B %d, %Y`+]


            I guess for this to work you need to install PHx.

            But Ditto has its own date formatting parameters you can use without extra addon, just use &dateFormat=`%B %d, %Y` in your ditto call. It will format the output of [+date+] in your ditto template.

            Hope this helps.
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 7231
              • 4,205 Posts
              I guess for this to work you need to install PHx.
              note: PHx is installed to use within a Ditto tpl grin
              Note: to use php to format the time (as in with Ditto or PHx) you need to start with a timestamp.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 24904
                • 79 Posts
                both methods work fine, thanks guys smiley
                  • 33337
                  • 3,975 Posts
                  Zaigham (aka zi) Reply #8, 18 years ago
                  Quote from: dev_cw at Oct 13, 2008, 05:18 AM

                  I guess for this to work you need to install PHx.
                  note: PHx is installed to use within a Ditto tpl grin
                  Note: to use php to format the time (as in with Ditto or PHx) you need to start with a timestamp.

                  thanks for the info Shane smiley , I guess I need to check under the hood with latest ditto... u know hidden treasures. lol
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 24904
                    • 79 Posts
                    Quote from: zi at Oct 13, 2008, 06:05 AM

                    Quote from: dev_cw at Oct 13, 2008, 05:18 AM

                    I guess for this to work you need to install PHx.
                    note: PHx is installed to use within a Ditto tpl grin
                    Note: to use php to format the time (as in with Ditto or PHx) you need to start with a timestamp.

                    thanks for the info Shane smiley , I guess I need to check under the hood with latest ditto... u know hidden treasures. lol
                    modx has lots of hidden treasures laugh