cancel
Showing results for 
Search instead for 
Did you mean: 

Default dashboard

liuk88
Champ in-the-making
Champ in-the-making
Hi!
Using presets.xml I've changed the default content of the user's dashbard.
Now I have to change once again the default content, but I've seen that changing presets.xml doesn't work because the dashboard shows the __previous__ default content and not the new one.
Restarting the server doesn't work as well.

What I've to do in order to get the new default content?
5 REPLIES 5

ddraper
World-Class Innovator
World-Class Innovator
The presets.xml is used to create a new dashboard page for each new user/site. Once that page has been created then changing the preset will not effect it - only pages that are subsequently created.

zladuric
Champ on-the-rise
Champ on-the-rise
Yes, the presets.xml is only a template. Once the usre is created, it gets stored as Share configuration <strong>for that user</strong>. For existing users you would have to walk through all of that store, for each user, and change their config.

There are quite a few posts on the forum asking how to do it.

liuk88
Champ in-the-making
Champ in-the-making
Thanks, can you link the posts that you saw about this?

santoshbaradwaj
Champ in-the-making
Champ in-the-making
Hi Liuk88,

For the change in existing users.
You have to customize the user-dashboard-title component.
for that extend user-dashboard-title component and add user-dashboard-title.get.js to it.

with in that file write logic like below…

var userName=user.name;
var dashboardUrl = "user/"+userName+"/dashboard";
var myDashletUrl = "NEW DASHLET URL";
var siteDashletUrl = "/components/dashlets/my-sites";
var documentDashletUrl = "/components/dashlets/my-documents";
function main(){
   var oldComponents = sitedata.findComponents("page", null,dashboardUrl, null);
   for ( var i = 0; i < oldComponents.length; i++) {
      var componentUrl = oldComponents.properties["url"].toLowerCase();
      if((componentUrl==myDashletUrl)==false){
         addBulletinDashlet();
      }
      if((componentUrl==documentDashletUrl)==false){
         addDocumentDashlet();
      }
      if((componentUrl==siteDashletUrl)==false){
         addSiteDashlet();
         break;
      }
   }
}

function addBulletinDashlet(){
   var bulletinComponent = sitedata.newComponent("page", "component-2-1", dashboardUrl);
   bulletinComponent.properties.url = myDashletUrl;
   bulletinComponent.save();
}
function addDocumentDashlet(){
   var documentComponent = sitedata.newComponent("page", "component-2-2", dashboardUrl);
   documentComponent.properties.url = documentDashletUrl;
   documentComponent.save();
}
function addSiteDashlet(){
   var siteComponent = sitedata.newComponent("page", "component-1-2", dashboardUrl);
   siteComponent.properties.url = siteDashletUrl;
   siteComponent.save();
}

main();

  

Ok, i'll try this, thank you!