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

    I am doing a site for friend’s part time real estate endeavors. I want the back end to be as simple as possible.

    I have a "Property Listings" container page that aggregates all the listings using Ditto. I have Ditto creating a custom date stamp, the document name (hot link), author name, summary intro text and a "read more link". Rather than just picking a certain number of words from the article I have the owner write down a one sentence text in the Summary box in TinyMCE. This works nicely.

    I also want to give him the option for adding a small image of the house that will appear with the Summary intro text. What I would like to do is create a TV that lets him navigate to these images that can then be added to the assets images folder and then have them appear in the Ditto aggregated content page. I need a class style to be connected with these images so I add padding etc.

    Right now my Ditto call chunk looks like this:
     <div id="dittoDisplay">
    [!Ditto? &parents=`16` &tpl=`dittoblogTemplate`  &display=`8` &paginate=`1` &paginateAlwaysShowLinks=`0`  &dateFormat=`%b %d %Y` &tplPaginatePage=`pageSplitter`  &paginateSplitterCharacter=`|` !]
    
    [+previous+] [+pages+] [+next+]
    </div>


    And my dittoblogTemplate looks like this:
    <div class="postdate"><span class="month">[*createdon:date=`%B`*]</span><span class="day">[*createdon:date=`%d`*]</span><span class="year">[*createdon:date=`%Y`*]</span></div>
    <div class="ditto_item" id="ditto_item_[+id+]">
        <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
        <div class="ditto_documentInfo">by <strong>[+author+]</strong> </div>
        <div class="ditto_introText">[+introtext+]<br/><a href="[+url+]"> read more...</a></div>
    </div> 
    


    Am I correct in thinking I can add a TV that would go above the [+introtext+] that would upload and present the images? The other issue is the size of the images here. I need the images that appear in the Ditto Summary to be 150 pixels wide. I don’t know if there is a script I can add that will resize larger versions of these images to fit into the DItto Summary format I envision? I might have to get the owner to resize these images by hand first?

    Thanks for any tips on the TV and added Ditto parameter here...
      • 26931
      • 2,314 Posts
      I don’t know if there is a script I can add that will resize larger versions of these images to fit into the DItto Summary format I envision? I might have to get the owner to resize these images by hand first?
      you could use phpThumb for resizing on the fly: http://modxcms.com/forums/index.php/topic,41309.msg248965.html#msg248965
        • 23299
        • 1,161 Posts
        Thanks for the link!

        For now I am working on getting the pics to load. What I did was add a span class to the introText class. The span includes a TV that I made with the Image widget. Adding some CSS (with the float property) to the class seems to work nicely. So, adding these images is pretty much like adding any images with the MODx manager. But in this case there is a TV window on these specific pages (handles the small summary image.) So far so good!

        Next up is the whole image size thing. I want the image thumb that appears floated next to the summary introText to be 100 pixels wide.
          • 26931
          • 2,314 Posts
          ...there’s also TVimageResizer http://modxcms.com/extras/package/566 ( haven’t used it yet )