AnsweredAssumed Answered

Overriding dashlet defaults in 4.2

Question asked by jaawerth on Jun 12, 2014
Hi folks! So I've been plugging away at customizing our Alfresco Community 4.2f installation, and one thing I'd like to do is set the default filters for users on Site dashlets. In particular, the site-activities dashlet: I'd like it to default to "Content" and "28 days". <a href="https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/change-default-options-dashlets-08092009-1045">This post</a> appears to be what I need, only the javascript is no longer embedded in get.html.ftl - no worries, I located the same type of code in site-webscripts/org/alfresco/components/dashlets/site-activities.get.html.ftl. Initially I tried that method to set the time filter, and I placed it in web-extension/site-webscripts/org/alfresco/components/dashlets/site-activities.get.html.ftl . However, upon restarting - nothing!

I also tried modifying the .xml to change the order - this works if I modify it directly, but when I try to overload them by placing them in that /web-extensions location, nothing. Am I getting the path wrong for overloading, or missing something else I need to do?

The other thing is, I'd also like to set the default activity type to "Content," but I don't see anywhere I can specify multiple (and specific) filters, and skimming the code I haven't found what the format I should use is. Any thoughts?



Thanks! Oh, and this is the modification I tried.

<javascript>
function main()
{
   // Widget instantiation metadata…
   var myActivities = {
      id : "Activities",
      name : "Alfresco.dashlet.Activities",
      assignTo : "activities",
      options : {
         siteId : (page.url.templateArgs.site != null) ? page.url.templateArgs.site : "",
         mode : "site",
         regionId : args['region-id'],
         activeFilter: "28" // Modified here!
      }
   };
}
</javascript>

Outcomes