cancel
Showing results for 
Search instead for 
Did you mean: 

change link for the document in the document library

edwin_s
Champ in-the-making
Champ in-the-making
Hello,

I am using Alfresco 3.0+ labs.  So, the default behavior when I click on the document name or the document thumbnail is to go to the document details page.  This is true in the simple and detail list view of a document library folder.  All our users have expressed that his is unintuitive since they would rather click on the title or thumbnail and just download the document.  So:

How can I change the link behavior for the title and thumbnail so that when a user clicks on it, it will simply download the document?

Thanks,
Ed
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
You'd need to override or edit the documentlist.js client-side JavaScript logic in the following places:

1 - renderCellThumbnail and renderCellDescription functions
Look for where the docDetailsUrl is generated and change that to
Alfresco.constants.PROXY_URI + record.getData("contentUrl") + "?a=true"

2 - If you want to add a new action to go to the details page, edit the documentlist.get.html.ftl (v3.0) or documentlist.get.config.xml (v3.2) to add the new action.
See http://wiki.alfresco.com/wiki/Custom_Document_Library_Action for hints on adding a custom document library action.

Thanks,
Mike

seaxom
Champ in-the-making
Champ in-the-making
Hello,

I am using Alfresco 3.2r Enterprise . I need exactly the same… change the link behavior for the document in the document library.

I've already edited the documentlist.js file replacing the docDetailsUrl value  using  Alfresco.constants.PROXY_URI + record.getData("contentUrl") + "?a=true",

But there is no change at all, even that deleted the file the library still shows. I've already restarted the server, clean the cache, and refreshed the webscrips but there is no change at all.

Is there any other file that I need to modify?, I dont understand from where is loading this funcionality

Thanks in advance.

mikeh
Star Contributor
Star Contributor
Make sure you also deploy a -min.js version of the file. Our build scripts generate this automatically by running it through the YUI Compressor. It's up to you if you compress the script or not, but the file with that name will likely be the one being loaded. You can confim this with a browser-based debugger.

Thanks,
Mike

seaxom
Champ in-the-making
Champ in-the-making
Hello Mike,

Thank you very much, It worked.

I ran it through the YUI Compressor, and generated the -min.js version of the file

First I used for docDetailsUrl value:
Alfresco.constants.PROXY_URI + record.getData("contentUrl") + "?a=true"

but it didnt show me anythink on the list, I searched on the same code and used oRecord.getData instead record.getData and it worked.

docDetailsUrl = Alfresco.constants.PROXY_URI + oRecord.getData("contentUrl");


Thank you again!!

kwilliamsjr
Champ in-the-making
Champ in-the-making
How do you change this behavior for the dashlet under site properties called "Recently Modified Documents". I keep looking for the location, and I can't seem to find it. it looks like a javascript called messages.js contains the information but I can't find that anywhere. I tried the my-documents.js under my-dashlets hoping it perhaps inherited this behavior from another script but no dice. Any input would be appreciated, i'll continue searching on my own.

-ken