cancel
Showing results for 
Search instead for 
Did you mean: 

Add dropdown in create site dialog box

jamil
Champ in-the-making
Champ in-the-making
Hi,

Please give some pointer to add drop-down in create site dialog box. Please look over attached file.

I know the change in freemarker. My main concern is that, once we select drop-down that value should be store in database so that I can fetch site based on region via CMIS query or Java API like we can fetch site based on site type.

I am using Alfresco 4.2

Thanks,
Mohammad
4 REPLIES 4

s_palyukh
Star Contributor
Star Contributor
Hi, I did the same task several times.

You should:

1) For Share Interface:
  
   - patch file webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/create-site.get.html.ftl where you will add your drop-down field into html
   - patch file webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/create-site.get.js where you can set data (or call alfresco to get data) for drop-down list
   - patch file webapps/share/modules/create-site-min.js if you need to add some validation

2) For Alfresco Interface

   - patch file alfresco/templates/webscripts/org/alfresco/repository/site/sites.post.json.js where you will save into DB your additional metadata.

jamil
Champ in-the-making
Champ in-the-making
I appreciate your time and help you have provided but I am still facing one issue. I am able to change freemarker and able to do other configuration. But I am unable to post additionalInformation drowdown value in the form of json object so that I can get value in “site-post.json. js” to store in content model properties.

I see below error when try to get var region = json.get("additionalInformation ");
Caused by: org.json.JSONException: JSONObject["additionalInformation "] not found.

I am struggling to post the “additionalInformation” value. I guess need to add some in this Create-site-min.js file to post custom dropdown value.

It would be great you can share custom code.

s_palyukh
Star Contributor
Star Contributor
I guess you forgot to set attribute "name" for your dropdown.


   <select id="${el}-additionalInformation" name="additionalInformation">
      <option value="option1">${msg("option.option1")}</option>
      <option value="option2">${msg("option.option2")}</option>
   </select>

muralidharand
Star Contributor
Star Contributor
Hi,
Can you please share your code?
I could not able to figure out that, where you're getting this error?

Thanks
Murali