cancel
Showing results for 
Search instead for 
Did you mean: 

How to add Images filter in myspaces web script?

relax
Champ in-the-making
Champ in-the-making
Hello,
I would add a Images filter in
GET /alfresco/wcservice/ui/myspaces?f={filter?}&p={path?}
web script.
To verify that a content is an image I want to check the mimetype in
GET /alfresco/wcservice/ui/myspacespanel?f={filter}&p={path}&h={home}

myspacepanel.get.html.ftl - original

         <#if d.isDocument>
            <a href="javascript:SelectFile('${url.context}${d.url}');"><img class="spaceIconImage" alt="" width="16" height="16" src="${url.context}${d.icon16?replace(".gif",".png")}" border=0></a>
         <#elseif d.type="{http://www.alfresco.org/model/application/1.0}folderlink">
            <#– the component parts need to build up an encoded url to the outer webscript –>
            <#– the client-side url encoder method of the outer webscript runtime will be used –>
            <span class="spaceNavLinkUrl">${url.serviceContext}/ui/myspaces?f=${args.f}&amp;p=${encodepath(d.properties.destination)}&amp;rp=${args.rp}</span>
            <span class="spaceNavLinkImg" style="display:none"><img class="spaceIconImage" alt="" width="16" height="16" src="${url.context}${d.icon16?replace(".gif",".png")}" border="0"></span>
         <#else>
            <span class="spaceNavLinkUrl">${url.serviceContext}/ui/myspaces?f=${args.f}&amp;p=${args.p?url}%2F${d.name?url}&amp;rp=${args.rp}</span>
            <span class="spaceNavLinkImg" style="display:none"><img class="spaceIconImage" alt="" width="16" height="16" src="${url.context}${d.icon16?replace(".gif",".png")}" border="0"></span>
         </#if>

What is the test to be performed to verify that content is an image in myspacepanel.get.html.ftl?

Thank you.
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
Have a look at doclistpanel.get.html.ftl which does some filtering on mimetype - that should get you pointed in the right direction.

Thanks,
Mike

relax
Champ in-the-making
Champ in-the-making
Ok!

This is test for Images filter in myspacepanel.get.html.ftl

(args.f="5" && (d.isDocument && d.mimetype?starts_with("image"))

Thank you