We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23375
    • 10 Posts
    Hi,
    I’m new to MODx, and i would like to:

    (1) create a news section in my website. Each news item should have a date (not the date the page was published, but a date related to the event the news item is about) and an image.

    (2) Show the last 5 news items in home page (news title, date and image for each news item).


    I know this can be done with Ditto, but I don’t know how to attach a specific image and a date to each news item, and to display them in the homepage.

    Also, the end user creating a new news item should be prompted to insert a date and an image, along with the standard document fields (title, description, content, etc)

    I hope this can be done without creating a custom snippet. I really like MODx but I’m having trouble figuring out how to make it easy for the end user to add new news items.

    Thanks in advance for your help!
    Pietro


      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That’s what Template Variables (TVs) are for. One with a "date" input type for the date, and another with an "image" input type for the image. Ditto will happily work with them.

      http://www.sottwell.com/how-template-variables-work.html
        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
        • 23375
        • 10 Posts
        Quote from: sottwell at Mar 26, 2010, 07:40 AM

        That’s what Template Variables (TVs) are for. [...]

        Thanks a lot, Susan!
        I’ll check it out