cancel
Showing results for 
Search instead for 
Did you mean: 

Modify library 'folder' toolbar (add buton & function)

studitechno
Champ in-the-making
Champ in-the-making
Hi All,

I tried to modify the library toolbar on Alfresco Comunity 3.2, not the one where you can find:
Site Dashboard | Wiki | Blog | Document Library | Calendar | Links | Discussions | Data Lists | Members

But the one just under, where are a few functions like:
Create Content | New Folder | Upload | Selected Items

Well, I've been looking on the Alfresco devellopment Wiki and other sites, to add a button to this toolbar, but I seem to be the first one to want to add a buton there..  :roll:
I've tried to modify the files that I thought to  be link with this toolbar, but the only result I got is an infinite loading message when I open my library…  :mrgreen:

Could someone please help me ?
Thanks, Studitechno
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
I've tried to modify the files that I thought to  be link with this toolbar, but the only result I got is an infinite loading message when I open my library…  :mrgreen:

Could someone please help me ?
What have you tried already?

Thanks,
Mike

studitechno
Champ in-the-making
Champ in-the-making
Hm, sorry, I forgot to develop more about what I did or not Smiley Indifferent

But I finally found how to add a buton in that tool bar:

IN C:\Alfresco\tomcat\webapps\share\components\documentlibrary\toolbar.css
ADD

.toolbar .createTag span.first-child
{
   background: transparent url(images/createTag-16.png) no-repeat 12px 4px;
   padding-left: 22px;
}

IN C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\documentlibrary\toolbar.get.properties
ADD

button.createTag=Create Tag

IN C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\documentlibrary\toolbar.get.html.ftl
ADD

         <div class="hideable toolbar-hidden DocListTree">
            <div class="createTag"><button id="${args.htmlid}-createTag-button" name="createTag">${msg("button.createTag")}</button></div>
            <div class="separator"> </div>
         </div>Tag

IN C:\Alfresco\tomcat\webapps\share\components\documentlibrary\toolbar.js
ADD
       
       /**
       * CreateTag module instance.
       *
       * @property createTag
       * @type Alfresco.CreateTag
       */
      createTag: null,

IN C:\Alfresco\tomcat\webapps\share\components\documentlibrary\toolbar.js
ADD
         
          // Create Tag button
         this.widgets.createTag = Alfresco.util.createYUIButton(this, "createTag-button", this.onCreateTag,
         {
            disabled: true,
            value: "create"
         });

IN C:\Alfresco\tomcat\webapps\share\components\documentlibrary\toolbar.js
ADD
     
       /**
       * Create Tag button click handler
       *
       * @method onCreateTag
       * @param e {object} DomEvent
       * @param p_obj {object} Object passed back from addListener method
       */
      onCreateTag: function DLTB_onCreateTag(e, p_obj)
      {
      var URLdossier = document.location.href;
      alert(URLdossier);
      },

Sorry, I've not lot of time to explain it all… But it works greate  :wink:
If this case the function use just above is useless, it shows the URL  :mrgreen:
But if you want to use it, change the "createTag" in something else and make a usefull function :lol:

EDIT: I forgot something: you should place an icon in C:\Alfresco\tomcat\webapps\share\components\documentlibrary\images called "createTag-16.png"

Thanks MikeH  :wink:

I still have an other problem (Alfresco's Tomcat don't starts on Win 2k3 server) but I think that will have to open a new thread somewhere else…

aascensao
Champ in-the-making
Champ in-the-making
Hi, studitechno

I followed your same steps but in ALfresco 3.4 but I can't make that button appear. Do you know some kind of incompability in this version?

Best regards,

André Ascensão

trandz
Champ in-the-making
Champ in-the-making
Hi Everybody!

I followed your steps (with Alfresco Community Version 3.4)…works fine…
Button is there. My Problem is the connection to a defined javascript. How did you solved that studitechno?
I tried lot of things, but the button seems to have no function. Could you please give me some hints?

Thanks,
trandz