Customizing My Activities

Answered

18 Comments

  • Vlad
    Community Moderator
    The Wise One - 2022

    Hi Joshua, you can make it on this way, just put this code on the very bottom of your the Requests HTML template:

    <script>
    $('ul.collapsible-nav-list li:first-child').text('My tickets');
    $('input#quick-search').attr('placeholder','Search tickets');
    </script>
    0
  • Josh Stewart

    Thanks Vladan!

    It did not work when added to the requests HTML page, but when added to the scrips.js file it worked, kind of. The search bar portion is fine, but the sub-nav gets wonky when navigating away from the 'My requests' to the other sub navs:



    Not only is the formatting off, but it is no longer clickable. 

    I think the code snippet that is responsible for the name is here:

    Specifically here:

    I can get it so the selected sub-nav says 'My tickets,' but it does it for every currently selected sub-nav.

    Thus far, I cannot figure out how to get that if-else statement to work the way I want.

    0
  • Vlad
    Community Moderator
    The Wise One - 2022

    Ahh, I see, please try this one:

    <script>
    $('ul.collapsible-nav-list li[aria-selected="true"]:first-child').text('My tickets');
    $('ul.collapsible-nav-list li:not([aria-selected="true"]):first-child a').text('My tickets');
    $('input#quick-search').attr('placeholder','Search tickets');
    </script>
    0
  • Josh Stewart

    That worked! You're the best!

    0
  • Vlad
    Community Moderator
    The Wise One - 2022

    Very glad that it helps! Thank you for your feedback and enjoy your even better Help Center! ;)

     

    0
  • Josh Stewart

    Sorry to bother you again. I assumed that I would be able to update the other two sub-navs based on the script you provided, but everything I have tried has not worked. Do you happen to know how to change the others?

    0
  • Vlad
    Community Moderator
    The Wise One - 2022

    np :) This one should work fine:

    <script>

    $('header.my-activities-header ul.collapsible-nav-list li:contains("CC")[aria-selected="true"]').text('CC tickets');
    $('header.my-activities-header ul.collapsible-nav-list li:nth-child(2) a').text('CC tickets');

    $('header.my-activities-header ul.collapsible-nav-list li:nth-child(3) a').text('Org tickets');
    $('header.my-activities-header ul.collapsible-nav-list li:contains("Organization")[aria-selected="true"]').text('Org tickets');

    </script>

    Let us know the result! ;)

    0
  • Josh Stewart

    It worked! I modified it a bit to be more consistent. Here is what I went with:

    <script>
       $('ul.collapsible-nav-list li[aria-selected="true"]:nth-child(1)').text('My tickets');
       $('ul.collapsible-nav-list li:not([aria-selected="true"]):nth-child(1) a').text('My tickets');

       $('ul.collapsible-nav-list li[aria-selected="true"]:nth-child(2)').text('Tickets I am copied on');
       $('ul.collapsible-nav-list li:not([aria-selected="true"]):nth-child(2) a').text('Tickets I am copied on');

       $('ul.collapsible-nav-list li[aria-selected="true"]:nth-child(3)').text('Organization tickets');
       $('ul.collapsible-nav-list li:not([aria-selected="true"]):nth-child(3) a').text('Organization tickets');
    </script>

     

    My edit had an unintended consequence. The headers for the upper navs are changed. 

    0
  • Josh Stewart

    In the end I went with this and all is working correctly:

    <script>
       $('header.my-activities-header ul.collapsible-nav-list li:contains("My")[aria-selected="true"]').text('My tickets');
       $('header.my-activities-header ul.collapsible-nav-list li:nth-child(1) a').text('My tickets');

       $('header.my-activities-header ul.collapsible-nav-list li:contains("CC")[aria-selected="true"]').text('Tickets I am copied on');
       $('header.my-activities-header ul.collapsible-nav-list li:nth-child(2) a').text('Tickets I am copied on');

       $('header.my-activities-header ul.collapsible-nav-list li:nth-child(3) a').text('Organization tickets');
       $('header.my-activities-header ul.collapsible-nav-list li:contains("Organization")[aria-selected="true"]').text('Organization tickets');
    </script>

    0
  • Jessie Schutz
    Zendesk Customer Care

    Thanks for coming back to share what you figured out, Joshua!

    0
  • Emily Coleman

    Is there a way to do this without using a script? The script runs a little late for my taste, so there's a brief moment where the original text is shown on the landing page before it changes. (This gif is kind of crappy because my page decided to take forever to load, but you can briefly see it at the end.)


    Any advice would be great!

    0
  • Jessie Schutz
    Zendesk Customer Care

    Hi Emily!

    I'm afraid a script is the only way to go about making these changes. I don't think there's much to be done about any potential lag, but I'll check with our Community Moderators to see if they know of any tricks.

    0
  • Trapta Singh
    Community Moderator

    Hi @Emily,

    Try the below code and let us know the results.

    Go to your requests_page.hbs template and replace the code from line no.1 to line no.7 with -

    <nav class="my-activities-nav collapsible-nav">
    <ul class="collapsible-nav-list container">
    <li aria-selected=true>My tickets</li>
    <li>{{link 'contributions'}}</li>
    <li>{{link 'subscriptions'}}</li>
    </ul>
    </nav>

    and from line no.12 to line no.24 with -

    <nav class="my-activities-sub-nav collapsible-nav">
    <ul class="collapsible-nav-list">
    {{#each filters}}
    {{#if selected}}
    <li aria-selected=true>
    {{#is name 'My requests'}}
    My tickets
    {{else}}
    Tickets I'm CC'd on
    {{/is}}
    </li>
    {{else}}
    <li>
    <a href="{{url}}">{{name}}</a>
    </li>
    {{/if}}
    {{/each}}
    </ul>
    </nav>

    Thanks

    Team Diziana

    0
  • Chris Booth

    Hi, 

    Where do we change the text for "Following"

     

    0
  • Trapta Singh
    Community Moderator

    Hi @Chris,

    You need to update the code in contributions_page.hbs, subscriptions_page.hbs, requests_page.hbs and request_page.hbs in order to change the text 'Following' from all the templates.

    Replace {{link 'subscriptions'}} with desired text in contributions_page.hbs, requests_page.hbs and request_page.hbs templates.

    Replace {{t 'following'}} with desired text in subscriptions_page.hbs template.

    Team Diziana

    0
  • Chris Booth

    Thanks Trapta,

    That hasn't worked. I changed the text but then nothing appears in it's place - any pointers?

     

     

     

     

    and request_page.hbs does not have anything in for subscriptions

     

     

    0
  • Trapta Singh
    Community Moderator

    Hi @Chris,

    Sorry for the late response. I cannot see that you have changed the text as per the screenshots you have shared.

    Once you will change the text, your code will look like -

    From

    <li class="my-activities-menu__item">{{link 'subscriptions'}}</li>

    To

    <li class="my-activities-menu__item">UPDATED TEXT</li>

    Team Diziana

    0
  • Chris Booth

    All good now - thank you

    0

Post is closed for comments.

Powered by Zendesk