We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52
    • 17 Posts
    Hello,
    I’ve been using MODx for a while now and i’ve been wondering if i’m missing a trick / technique somewhere along the way.

    So say i have a client who wants to add some info to a page for a set of projects. e.g
    <h3>Header</h3>
    <p>Paragraph text here</p>
    <a href="####"><img src="###" /></a>
    


    Now usually if they want 6 ’projects’ on a page, i repeat this code in the page template 6 times, then add 6 sets of template vars to the template. So..
    <h3>[*projectHeader1*]</h3>
    <p>[*projectPara1*]</p>
    <a href="[~[*projectidLink1*]~]"><img src="###" /></a>
    
    <h3>[*projectHeader2*]</h3>
    <p>[*projectPara2*]</p>
    <a href="[~[*projectidLink2*]~]"><img src="###" /></a>
    


    I’m sure i’m making this harder than it can be. Now say the clients want to add an unlimited amount of projects, is there some way of adding another set of template vars over and over?

    I know i could let the client do this in the main content window, but that would require them to know a little html, and also risk breaking the page.

    Thanks in advance.
      • 7455
      • 2,204 Posts
      It would be better to use a document for each project and use Ditto to sum them up on one page. that way its easy to maintain.
        follow me on twitter: @dimmy01
        • 52
        • 17 Posts
        Ah okay, i already use ditto for various other things so i may as well use it again.

        I guess there is no need to link through to the actual page itself, just create them to be used on the one page. Only reason i say that is because the amount of copy that the client wishes to place on the page would hardly warrant a whole new page smiley

        Thanks for the quick reply.