Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kris Janssen 210 posts 569 karma points c-trib
    Jul 31, 2014 @ 15:04
    Kris Janssen
    0

    Archetype multi row property editor on the front-end

    Hi guys,

    I have been playing with the idea of using Archetype to come up with a custom "CV" properties for site members.

    If I am not mistaken I can create a new "CV" property in Archetype by just combining a few text string fields; one for the date, one for a brief description.

    Next, I could add as many entries as I wanted to the "CV" property.

    However, I also want to give members the opportunity to edit their CV from a dedicated page on the front-end, to not have to give them access to the back end.

    I can do that easily for simple properties of my members.

    However, I am a bit stuck as to how I should deel with a customised Archetype property: it is not enough to just get the stored data, somehow parse it and show sub items in a suitable editor. Users would also need to be able to add rows to the CV.

    How would I go about that? Should I use some custom angular for that? Are there any known examples of something like this anywhere?

    Cheers,

    Kris

  • Kris Janssen 210 posts 569 karma points c-trib
    Jul 31, 2014 @ 15:07
    Kris Janssen
    0

    I guess that question could be expanded to "how to create a front end editor for any property created using Archetype"

  • Kris Janssen 210 posts 569 karma points c-trib
    Jul 31, 2014 @ 15:38
    Kris Janssen
    0

    I did some more thinking, also looking at the very interesting Imulus TableEditor.

    So, taking Imulus TE as an example (should be similar to Archetype, but simpler:

    1. I could put a property on my members of type "Imulus TE".
    2. I can make a suitable standard MVC Model that represents all member properties (Name, Email, CV) much like I already did once here (Thanks to the excellent ground work of Warren B). This time also including a "CV" property.
    3. I can generate a suitable Surfacecontroller that has an action to load my member data and display it and an action to handle the update as I also already mostly have here.

    Specifically for for my CV property, I can probably always cast the "CV" property of my member model to the TableEditor model. I could next traverse that model in my action to display text boxes holding the table data.

    That leaves me with the main problem:

    How do I generate a "dynamic" control that would allow me to keep on adding rows to the tabular data?

    I m specifically stuck there because, provide that I have that part of the equation, it is easy enough to serialize the amended table data and put it back into my member model.

    Doing server side stuff I' m familiar with, I lack experience doing client side things...

Please Sign in or register to post replies

Write your reply to:

Draft