1

I am working on a sharepoint server 2013, and i have added a Discussion Board list. where inside the default Subject view there is a link named "What's Hot" as follow:-

enter image description here

so can i change the link text to be "Management" instead of "What's Hot", and change the URL's href to be referencing the built-in management.aspx view ??

now i usually use self-executing anonymous functions to achieve this kind of customization. For example to change the text for the create new discussion link from "new discussion" to "updated name", i use the following function loaded inside a script editor:-

<script type="text/javascript">
//self-executing anonymous function
(function () {
    // String overrides
    function DiscussionListViewStringOverride() {
        Strings.STS.L_SPDiscHeroLinkAltText = "updated text";
        Strings.STS.L_SPDiscHeroLinkFormat = "Updated name";
    }

    DiscussionListViewStringOverride();
    ExecuteOrDelayUntilScriptLoaded(DiscussionListViewStringOverride, "strings.js");
})();
</script>

so can i follow similar approaches to change the "What's Hot" link name and href?

  • It's a view. The Title and the Link of a view can be changed in the list settings. – Nico Feb 27 '17 at 16:30
  • 1
    @Nico sorry i did not understand you reply.. now the "what's hot" link which i want to modify its href and name is not a view by itself... – john Gu Feb 28 '17 at 0:11
  • Sorry ! my mistake ! recent, what's hot, my discutions... is in the Default View of the discution board. The default View title is "Subject". To Update "What's hot" you need to updated this default view (witch is in read only). 2 Solutions, you can edit the view using SharePoint Designer (change the property Read Only, and customize his rendering) Or you can use the property JSLink of the view to execute a custom JavaScript file whitch update you text and link – Nico Feb 28 '17 at 8:41
  • 1
    For use the JS Link, you can put you javascript File in a style library (for exemple) and in webPart properties of your view (pass the page in Edit mode), put the link of your file. After for the how to update label and link, i don't know how to implement it (if there is a methode in the JSOM, or not). But for exemple you can use CSS selector, and text valeu (warning if you have your multilanguage enabled in your site) – Nico Feb 28 '17 at 14:47
  • 1
    @Nico i thought of using css selectors.... but in this case i will be hard-coding the sharepoint css classes names (which i do not have any control over them),, and i am not sure if these classes can change in the future if we apply a comulative updates.. so i was searching of a more standard/robust solution.. – john Gu Mar 1 '17 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.