Hello,

not sure the subject is clear...
I have this simple structure:
- document
-- page(s)
--- component(s) : 1 to 4 on each page

Those components can be of different type : image, text, map, graph. For
each I have a different sling:resourceType for the node and a corresponding
view (JSP)

I'd like to have a form on each component, to allow user to add comments.
They would be created under this path:
/document/pages/page1/components/component1/comments/*

For now I have only two component types: text and image
so in imageComponent/html.jsp I have this:

<sling:include path="${resource.path}" replaceSelectors="comment"/>

and next to html.jsp I have comment.jsp which contains this form: <form
method="POST" action="${resource.path}/comments/*" />

But I have the same in textComponent/. And so far I would have to duplicate
this form for each component type. I'm pretty sure there is a better way to
do it but I don't know how.

Having a specifig resourceType for the comment form would allow me to have
only one, but then I don't know how I could pass the "action" parameter
(e.g. the resource path) to this view.

I bet it's a simple requirement but I didn't find any tips in the document
nor in some examples I've found online.

Thank you for your help!

Regards,
Guillaume

Reply via email to