cancel
Showing results for 
Search instead for 
Did you mean: 

Adding .png files to the site

mcchapman
Champ in-the-making
Champ in-the-making
Hello.

Can someone please give some help on where to put .png files if you want them to appear in dashlets?
For example, I want a .png file to appear on the My Activities dashlet how would I do that?
Regards
mcchapman
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
Static files like images, CSS, and client-side JavaScript go in the root of a web application, typically in a directory that keeps your stuff separate from Alfresco's. For example, you might choose to put an image in $TOMCAT_HOME/webapps/share/extension/images/foo.png.

Putting the image in that folder won't make it magically appear in any dashlet. You'll have to add an image reference to that dashlet's markup to make that happen. The right way to do that is to extend the web script that creates the dashlet.

To do that for "My Activities", you need to find the web script, which happens to be in:
$TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/dashlets

If you are using Alfresco 4 and you need to find some other web script for a given dashlet, consider using Surf Bug, which is available at http://localhost:8080/share/service/index.

Now you need to copy that directory structure into Share's web-extension directory to keep your override separate from Alfresco's. So you'd create the following directory structure:
$TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets

The markup used to create that dashlet lives in my-activities.get.html.ftl so copy that file from the out-of-the-box location into the new web-extension structure you just created.

Now edit the file to add your image reference, then save.

To make your change take effect, either restart Tomcat or go to http://localhost:8080/share/service/index and click "Refresh Web Scripts".

Jeff