Expand my Community achievements bar.

SOLVED

Populate Tags in Drop Down

Avatar

Level 5

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

5 Replies

Avatar

Level 2

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

Avatar

Correct answer by
Level 10

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.

Avatar

Level 5

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

Avatar

Level 10

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