We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8323
    • 14 Posts
    Hello everyone,

    I would likely use some help from more knowledgeable people smiley

    Let me introduce my issue;

    Let’s say I have list of images:
    <ul>
       <li><img src="image1.jpg" alt="Image1" /></li>
       <li><img src="image2.jpg" alt="Image2" /></li>
       <li><img src="image3.jpg" alt="Image3" /></li>
    </ul>
    

    Simple, right? I just create three TVs, assign them to template and vóila.

    Now, how about I want to add more / edit / or remove those images as of my likings, needs or expectations using CMS. For example, leave only 2 images or get up to 5.
    Logical approach, I believe (meh, if I am not so logical then please don’t shout laugh), would be to have a funny, little button near every field in Edit resource page:
    << Remove >>
    And << Add >> below all of those fields.

    Pressing second one adds new field, which is very same TV as first, second, third and so on. Something like TV group that uses one TV parameters to every field that gets generated and does +1 to array or however to call it.
    Remove, really, removes the field which is nearby.
    Field is simply image input/file input and get’s formatted by TV to be wrapped in li tag. It goes to chunk which puts it inside some div and ul, for example.

    Question is.
    Is it doable in MODx? If so, how? If not, do you see any alternative? I am using REVOLUTION rc3.
    I know that you can handle it using Ditto call of few different resources. But, after reading that adding resources for every simple thing is bad approach it makes me wonder how to handle such behaviour in only one resource. And, it’s not flexible really with Ditto, or at least not fast and easy. And we have AJAX for something, right?

    There are unlimited uses of that. Creating whole galleries of text description (how about duplicating two fields at once? i.e. image field and it’s description?) and images (as many as you like per lightbox) in one resource. How about that? It may feel bloated, possibly. But, simpler use like FAQ list with accordion menu toggle hide/show? The point is user can handle every Frequently Asked Question in separate field. It is doable from one content or TV field but I do not want to teach my customers to add ’icon’ class to every icon image he wants to have near every question. Because it needs to float and have position: absolute just to keep all intact. I want it to be done from separate field that has output formatted as I coded and prepared.

    Is my vision over any expectations?
    The inspiration comes from Symphony CMS which I had to use lately. Yes, I was forced. But it wasn’t so bad actually. Still, I do prefer MODx much more but this little one thing is so good that I have to know why it is not here or if I am blind ;<
    I have only worked with Symphony for a short while and I do not know it’s full possibilities, it surely is more complicated than MODx and I am not sure if my customers will even handle using it, but adding fields from administrator level is astonishing.

    Thank you everyone for your time!
    The community here is adorable, I hope to not get disappointed this time either smiley

    Once more, great thanks.
      • 8323
      • 14 Posts
      I guess it can not be done? If I am unclear please let me know and I will try to explain better.

      Thank you!