Populate Tags in Drop Down | Community
Skip to main content
Level 5
October 16, 2015
Solved

Populate Tags in Drop Down

  • October 16, 2015
  • 5 replies
  • 1182 views

Hi, 

Is there any way to populate the tags from /etc/tags/mysite/catrgory/category1/.. in my drop down menu inside dialog. With help of json i can populate my mapping json file in option, but looking for any other alternative as if the tags will add and remove json has to be changed from crxde. And this thing should be configure by business user or super user via ui.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

vdhim23 wrote...

Hi, 

Is there any way to populate the tags from /etc/tags/mysite/catrgory/category1/.. in my drop down menu inside dialog. With help of json i can populate my mapping json file in option, but looking for any other alternative as if the tags will add and remove json has to be changed from crxde. And this thing should be configure by business user or super user via ui.

Thanks

Use TagInputField and implement filter to hide based on business logic.  Might need to provide custom interface to define filter.

5 replies

Level 2
October 16, 2015

Hi there,

Not entirely sure about the 2nd part of your question, but an author doesn't need access to CRXDE Lite to add or remove tags.  They can administer tags in the Tagging Admin Console, ie: http://localhost:4502/tagging

 

SLIM

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

vdhim23 wrote...

Hi, 

Is there any way to populate the tags from /etc/tags/mysite/catrgory/category1/.. in my drop down menu inside dialog. With help of json i can populate my mapping json file in option, but looking for any other alternative as if the tags will add and remove json has to be changed from crxde. And this thing should be configure by business user or super user via ui.

Thanks

Use TagInputField and implement filter to hide based on business logic.  Might need to provide custom interface to define filter.

vdhim23Author
Level 5
October 16, 2015

Thanks, I shifted to another approach which i seems simple. Now i have node in which has a property which contains the json format that required to drop down.

[{"text":"Type1","value":"Type1"},{"text":"Type2","value":"Type2"},{"text":"333","value":"333"}]

I have fie options.json.jsp within the compoent along with component.jsp

<%@include file="/libs/foundation/global.jsp"%><% response.setContentType("text/plain"); %><% try { Node parent = resource.getResourceResolver().getResource("/etc/IgWebCMS/articletypes").adaptTo(Node.class); String json=parent.getProperty("json").getString(); System.out.println("options json :::: "+json); } catch (RepositoryException re) {} %> ${json}

In Stdout.log it shows me : 

options json :::: [{"text":"Type1","value":"Type1"},{"text":"Type2","value":"Type2"},{"text":"333","value":"333"}]

And in the dialog drop down i mentioned the options property as : $PATH.options.json

But in my dialog that values are not getting populate. Any idea.

Thanks

Sham_HC
Level 10
October 16, 2015

vdhim23 wrote...

Thanks, I shifted to another approach which i seems simple. Now i have node in which has a property which contains the json format that required to drop down.

  1. [{"text":"Type1","value":"Type1"},{"text":"Type2","value":"Type2"},{"text":"333","value":"333"}]

I have fie options.json.jsp within the compoent along with component.jsp

 
  1. <%@include file="/libs/foundation/global.jsp"%><%
  2. response.setContentType("text/plain");
  3. %><%
  4. try {
  5. Node parent = resource.getResourceResolver().getResource("/etc/IgWebCMS/articletypes").adaptTo(Node.class);
  6. String json=parent.getProperty("json").getString();
  7. System.out.println("options json :::: "+json);
  8. }
  9. catch (RepositoryException re) {}
  10. %>
  11. ${json}

In Stdout.log it shows me : 

 
  1. options json :::: [{"text":"Type1","value":"Type1"},{"text":"Type2","value":"Type2"},{"text":"333","value":"333"}]

And in the dialog drop down i mentioned the options property as : $PATH.options.json

But in my dialog that values are not getting populate. Any idea.

Thanks

 

 

$path should point to content page path + component path

vdhim23Author
Level 5
October 16, 2015

Thanks that worked