cancel
Showing results for 
Search instead for 
Did you mean: 

Icon file for custom page used in 'Customize site'

rjohnson
Star Contributor
Star Contributor
I have successfully created a custom site page for Share and added it to Share so that it is displayed in the list of "Available site pages" when you select "Customize site" from the "More" drop down menu.

At first, the icon that was displayed for the new page in the "Available site pages" panel was called page-64.png. I quickly worked out that the system was looking for a file page-{page-id}-64.png and if it couldn't find it (or got an error loading the page details) defaulted to page-64.png.

I created an icon, popped it into tomcat/webapps/share/components/images and sure enough it displayed properly.

However, once again I had put a "custom" item into the "standard" folders which I wanted to avoid so I tried putting this image in various places in the customisation directories where I had created my new site page files (tomcat/shared/classes/alfresco/web-extension/…….. etc). Unfortunately, no matter where I put the icon file the system didn't find it unless it was in tomcat/webapps/share/components/images.

My question is really, can I put the page icon file in the customisation directories and if so, where; or does the page icon file have to be in the "standard system directory"?

Thank you all in advance for your help.
1 REPLY 1

erikwinlof
Confirmed Champ
Confirmed Champ
Hi, no unfortunately you cannot specify where the icon shall reside, so the icon must be placed to match the url just like you say:
${url.context}/res/components/images/page-${page.pageId?js_string}-64.png

I thought it could be wort adding a few notes about how to deploy the custom icon though. You might already know this but maybe somebody else finds it to be useful information…

A) Using an AMP
Rather than manually copying the icon into the tomcat/webapps/share/components/images folder I suggest taking a look at packaging your custom files in an amp file. An amp file can then be deployed to the server using the amp tool, meaning you don't have to manually "touch" the source files and folder in  tomcat/webapps/share.

For more info about amps look at…
http://wiki.alfresco.com/wiki/AMP_Files
…and since you want to package client side assets (such as .js & .png etc) make sure you pay attention to the example in…
http://wiki.alfresco.com/wiki/AMP_Files#Customising_the_structure_of_an_AMP_file

B) Using a .jar file (preferred!)

However rather than using an AMP file which will "merge" your custom files into the alfresco source files inside your tomcat webapp folder, I suggest you package your custom files in a .jar file which then can be placed in tomcat/shared/lib so you always know that you only have alfresco source files in tomcat/webapps/share. Client side assets can be place inside the .jar files META-INF folder, in other words tomcat/shared/lib/your-extension.jar!META-INF/components/images/page-THE_PAGEID-64.png

For more information about packaging extensions in a .jar file…
http://blogs.alfresco.com/wp/kevinr/2010/01/28/alfresco-share-33-extensions-and-springsurf/

Cheers, Erik