Il est bien plus beau de savoir quelque chose de tout que de savoir tout d'une chose. [Blaise Pascal]

Enhance the “Track your work” web part

24 comments

For once, a short article with a quick tip on how to enhance the Track your work web part, on your Project Online home page, by updating some links and changing the colour of the tiles.


The challenge (or as Simon Sinek says “Start with why”)
I had to create a brand new custom Report Centre, which contains some videos, help documents, images and our reports. I am a big fan of the Track your work web part, on my home page. It does not only contain links to the most important features, but it is also security trimmed and provides some additional information, such as the numbers of pending approvals, tasks assigned to you, risks or issues, timesheets or status reports...
The solution would be either to create a new Promoted Link web part (but I’m not sure how to deal with the numbers), or just for the Reports link, override the original link (/PWAReports/Forms/AllItems.aspx) with the URL of my new Report Centre (which I did).

The solution
This is easily doable using some JavaScript and jQuery. Here is the process:
Edit your home page, go to the wheel menu and select Edit page.


Add a Content Editor Web part to your page.


Edit the Source of the web part to add some JavaScript code.


Here is the code:
<script src="/sites/myPWA/Shared%20Documents/jquery-3.1.1.min.js" type="text/javascript"></script><script>
$( document ).ready(function() {
$('.ms-tileview-tile-root:nth-child(7n + 4)').find('a').attr("clickaction", "PreventDefaultNavigation(); STSNavigate('ReportCentre.aspx'); return false;");
});
</script>
As this code is using jQuery, you must add the jQuery library into one of your site document library.
(7n + 4) is the 4th tile of your web part (in my case, the Report one). You can check the documentation of the nth-child selector here: https://api.jquery.com/nth-child-selector/.
Update the URL of destination.
And that’s it J

Going further (not to say “useless stuff”)
I tried also to play with the other properties and made some test on CSS classes, my idea was to try to change the colour of the tiles.
In the same Content Editor Web Part (or in another one), add the following code that override the background colour. You can search for SharePoint CSS reference charts, e.g., this one is for SharePoint 2013: https://blog.sharepointexperience.com/2013/05/31/sharepoint-2013-css-classes-that-suck-and-save-the-day/. I used this in the past to update a List View web part to add alternate row colour.
<style type="text/css" unselectable="on">
div.ms-tileview-tile-root:nth-of-type(7n + 1).ms-tileview-tile-content {
background-color: #A995C1; /* Purple */
}
div.ms-tileview-tile-root:nth-of-type(7n + 2).ms-tileview-tile-content {
background-color: #FFDE7B; /* Yellow */
}
div.ms-tileview-tile-root:nth-of-type(7n + 3).ms-tileview-tile-content {
background-color: #64D9E9; /* Light Blue */
}
div.ms-tileview-tile-root:nth-of-type(7n + 4).ms-tileview-tile-content {
background-color: #D467A3; /* Pink */
}
</style>
Same tip for the nth-child selector, (7n + 1) being your first tile.

And you are done. 



24 comments :

  1. Great ¡V I should certainly pronounce, impressed with your site. I had no trouble navigating through all tabs as well as related info ended up being truly easy to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your client to communicate. Excellent task.. website designers san francisco

    ReplyDelete
  2. I am not really excellent with English but I line up this really easygoing to understand . web design san francisco

    ReplyDelete
  3. Hello! I just now would choose to supply a massive thumbs up for that great info you have here with this post. We are returning to your blog site to get more detailed soon. web design la

    ReplyDelete
  4. "
    I was just examining through the web looking for certain information and ran over your blog.It shows how well you understand this subject. Bookmarked this page, will return for extra."
    hrdf contribution

    ReplyDelete

  5. This post is incredibly simple to examine and recognize without disregarding any nuances. Inconceivable work! PMP

    ReplyDelete
  6. so happy to find good place to many here in the post, the writing is just great, thanks for the post.
    digital marketing courses in hyderabad with placements

    ReplyDelete
  7. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you! Webdesign

    ReplyDelete
  8. While you might be thinking about outsourcing with the goal that you can uphold others, having your own help group is essential to the achievement of your direction for living.Professional graphic design

    ReplyDelete
  9. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! best parental control app

    ReplyDelete
  10. What a good blog you have here. Please update it more often. This topics is my interest. Thank you. . .
    updated blog post

    ReplyDelete
  11. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. best diet pills

    ReplyDelete
  12. Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. GPS tracking

    ReplyDelete
  13. Quality Web design service Usually, the companies like to upgrade the previous site rather than totally making a novel website, since it is inexpensive and simple to do. At present, the sites are made taking into account the wants of the users as well as the kind of web presentation and information that would impress the users. Website Development Toronto

    ReplyDelete
  14. To make a web webpage or a web presence, one needs to utilize a website design organization. Additionally, verify that the website design organization should have a gathering of experienced web designers, engineers, developers and analyzers and so on so you can get a wide range of administrations under one rooftop.support me on patreon

    ReplyDelete
  15. How to Make Yahoo My Homepage on Chrome?

    If you want to know about how to make Yahoo my homepage on Chrome then open Google Chrome and tap on settings option. Toggle the bar for the option show home button under the appearance section. After that, click on enter custom web address option under show home button option. Choose the address that you want to open while clicking on home button. Here, enter Yahoo page that you want to set as homepage. At the bottom, you will see the option for opening a specific page or set of pages. Tap on add after entering the address that you want to see once Chrome launches. Lastly, you can smoothly add multiple Yahoo pages and it will open in separate tabs.

    How to Turn Off Outlook Notifications on Phone?

    Check out the steps mentioned in the guide and know how to turn off Outlook notifications on phone. If you are an Android Gmail user, then start by opening the Gmail application and tapping on the local left menu button. After that, scroll down to the bottom and choose Settings. Lastly, click to account and then uncheck the notifications. These are the steps that users need to follow to smoothly turn off the Outlook notifications on their mobile phone. It is advisable to follow the steps properly to perform the function properly.

    How to Deal with Microsoft Outlook Search Not Working?

    Sometimes third-party add-ins built to boost the user’s productivity and because of this, users encounter Microsoft Outlook search not working issue. If you want to know about the steps to disable add-ins then start by launching Outlook and choose your File tab. Here, click on options and then click on add-ins from the list. A list of the add-ins includes the active, inactive, and disabled add-ins will appear on the screen. Choose COM add-ins from the manage list and tap to go. Here, untick the add-ins that you want to disable and choose to OK. Lastly, you need to see the effect of disabling the add-ins and then you need to restart the Outlook application.

    ReplyDelete
  16. Hey I am john smith I am working in technical team . Are you facing problems with Yahoo Emails. They will provide you instant solutions to solve this all yahoo email issues.

    Fix yahoo sign in error

    Yahoo customer service

    ReplyDelete

  17. How to dispute a charge on cash app, Check my blog
    Cash App Chargeback

    ReplyDelete

  18. Can you get your money back on Cash App?
    Check Full Information, if you have any doubts, then feel free to contact our technical support
    Cash app Refund Policy

    ReplyDelete
  19. As the actual name make sense of that its a totally private hosting administrations.https://onohosting.com/

    ReplyDelete

  20. Role Of Sutton Bank Cash App ?
    Sutton Bank is a bank and acts as a card issuer for the Cash App account, who are using the verified Cash App account. if someone does not have sufficient information Connect with us Sutton bank cash app

    ReplyDelete
  21. Can’t Sign into Yahoo Mail on Android?
    There are times when users encounter with the issue of can’t sign into Yahoo mail on Android device. if you are dealing with the one then check out the steps to log into Yahoo mail. To do that, open Yahoo mail app. if you are not signed into mail account then you will see the sign-in page. Click on sign in with Yahoo. Here, type Yahoo username, mobile number, and email linked with the account and click next. Enter password and tap to next. After sometime, you will be signed in and users can smoothly access the inbox.

    ReplyDelete
  22. How to Sync Gmail on All Devices?
    If you are dealing with a query about how to sync Gmail on all devices, then your first step should be to update the Gmail application. It is advisable to keep it free from bugs and resolve the issue. To know about the steps to deal with the sync Gmail on all devices then, you need to update the Gmail application. To do that, launch the Play store and click on the search bar and then search for Gmail. Lastly, tap on it. If you see the update button, then click to get the latest version available for your Gmail application.

    ReplyDelete

Note: Only a member of this blog may post a comment.