We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20349 ☆ A M B ☆
    • 453 Posts
    Hi!
    I’m using NewsPublisher and Ditto to have news on my index (10 news per page).
    My question is: how can I put avatars in news (somethin like extra field that I would insert URL of the image)?

    I tried something with TV’s but with no luck. sad


    P.S. and where to change the date format on [+date+] call so it would output this date: "05.04.2007." (instead of "5-Apr-07 19:06"

    Thanks in advance!
      BASE - Web Design Studio
      MODX Ambassador

      Website
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      TVs are the way to do this. Set up an image type TV as usual, then in your ditto template specify the name of the TV to include in the summary listing. See the documentation for your version of Ditto for the exact syntax to use.
        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
        • 20349 ☆ A M B ☆
        • 453 Posts
        Quote from: sottwell at May 02, 2007, 01:31 PM

        TVs are the way to do this. Set up an image type TV as usual, then in your ditto template specify the name of the TV to include in the summary listing. See the documentation for your version of Ditto for the exact syntax to use.
        I tried something out with TV’s but I can’t get it work...
        Can you write me an example? (I’m using Ditto 2.0 RC2)

        My ditto call (on index page) is
        [[Ditto?&startID=`2` &summarize=`10` &removeChunk=`Comments` &tpl=`naslovna_vijesti`  &paginate=`0` &extenders=`date,summary,dateFilter`]]


        ..and my chunk with tpl is
        <div id="title">[+date+] - [+title+]</div>
          <div class="clear"></div>
        <div id="text_vijesti">[+summary+]</div>
          <div class="clear"></div>
        <div id="autor_vijesti">Napisao [+author+]</div>
          BASE - Web Design Studio
          MODX Ambassador

          Website
          • 34017
          • 898 Posts
          In pre-2.0 Ditto, you need to call your tv’s with the prefix "tv".

          So you create your image TV called "Avatar". Then in Ditto, the call is: [+tvAvatar+]. Of course, in your page you’d need to put <img src="[+tvAvatar+]" />
            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • 24530
            • 100 Posts
            PS: have a look at
            http://ditto.modxcms.com/files/snippet-ditto-php.html#dateFormat

            ... I used in combination a small plugin to set the date locale format global for all snippets:

            Plugin Name:
            setlocaleDE

            Plugin-Code:
            setlocale(LC_TIME, "de_DE");

            System Events:
            OnLoadWebDocument
              my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
              • 20349 ☆ A M B ☆
              • 453 Posts
              Quote from: ProWebscape at May 03, 2007, 10:40 PM

              In pre-2.0 Ditto, you need to call your tv’s ....
              It worked! Thanks a million!!!!! kiss


              Just one more thing:
              How can I add some input field on my add-news page?

              I’m now getting images from the manager, but I want to put the URL directly when I write some news...


              Quote from: raum at May 04, 2007, 07:37 AM

              PS: have a look at
              http://ditto.modxcms.com/files/snippet-ditto-php.html#dateFormat

              ... I used in combination a small plugin to set the date locale format global for all snippets:

              Plugin Name:
              setlocaleDE

              Plugin-Code:
              setlocale(LC_TIME, "de_DE");

              System Events:
              OnLoadWebDocument
              I worked it out in dateFilter.extender in the meantime, but thanks for the hint wink
                BASE - Web Design Studio
                MODX Ambassador

                Website