cancel
Showing results for 
Search instead for 
Did you mean: 

Create site in the dropdown list in 3.4 [Solved]

michaelc
Champ on-the-rise
Champ on-the-rise
I have spent the morning chasing my own tail.
  in the prior version I had a group that had site create.
simple change in the mySites dashlet - same logic.

  but the dropdown Javascript has me lost.

  I see
                <item type="js" id="sites">
                    Alfresco.module.Sites
                </item> 

  in sites.js there is a call to modules/header/sites
  this is where it comes from, but where is modules/header/sites ?
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
The sites.js code is a fairly thin wrapper to handle the Sites dropdown. When the "Create Site" option is clicked
Alfresco.module.getCreateSiteInstance().show
is called.

This is defined in modules/create-site.js

Thanks,
Mike

michaelc
Champ on-the-rise
Champ on-the-rise
I got it, just did not load it correctly.

you call Alfresco.module.Sites
  changes to this go in shared/classes/alfresco/web-extension/site-webscript/modules/header
   site.get.html.ftl  generates the code that the AJAX call gets. 

    So I modified sites.get.js to create a parameter  model.createSite = createSite;
     then in   site.get.html.ftl

       <#if createSite>
      <ul class="create-site-menuitem">
         <li>
            <span><a href="#" onclick='Alfresco.util.ComponentManager.get("${id_js}").showCreateSite(); return false;'>${msg("label.create-site")}</a></span>
         </li>
      </ul>
      </#if>