Show more than 5 items in Recent Activity

10 Comments

  • Jose Gonzales
    Comment actions Permalink

    If the option to show unsafe code is off, will it affect the functionality of this code?

    0
  • Vladan Jovic
    Comment actions Permalink

    Hi Jose, I think that making any changes in that option will not affect provided code in any way. Let me know if any further question. 

    0
  • Jose Gonzales
    Comment actions Permalink

    Thank you @Vladan. Hmm I can't seem to get this snippet to work.

    |Edit:
    Had a missing bracket! Now it is working like a charm!

    0
  • Vladan Jovic
    Comment actions Permalink

    Glat to hear it worked, Thanks for the feedback Jose!

     

    0
  • Jennifer Rowe
    Comment actions Permalink

    Thanks, Vladan! Another good one from you.

    I missed this while I was on vacation. But I just added it to the Guide community tips list!

     

     

    1
  • Duane Knudsen
    Comment actions Permalink

    Vladan, thanks. What a nice little mod for our HC.

    1
  • Rebecca McMurry
    Comment actions Permalink

    I like this idea but it is not working for me. I see the note that a bracket is missing. What is the correct snippet?

    This is not working for me?

     

    });
    setTimeout(function(){
    $('.recent-activity-controls a')[0].click()
    }, 800);
    });

    0
  • Duane Knudsen
    Comment actions Permalink

    Try this. Drop the extra characters before and after, insert at the very end of your js file, worked for me:

     

    setTimeout(function(){
    $('.recent-activity-controls a')[0].click()
    }, 800);

    0
  • Jason Hetherington
    Comment actions Permalink

    Don't use setTimeout for automated page actions like this. If a user is on a slower connection this will do nothing because that button won't exist in the DOM yet.

    Instead wait until the page is fully loaded and then perform the automated click.

    $(window).load(function() {
      $('.recent-activity-controls a')[0].click()
    });

    You can also target the element by the unique attribute, this might shave a little off the time it takes to click the rendered element.

    $(window).load(function() {
      $('[data-recent-activity-seemore]')[0].click()
    });

    Edit: You may see a console error using the above described method on some browsers (maybe load order of js since the button runs on js as well) if that happens add the setTimeout inside the window.load function, just don't use setTimeout on it's own and expect good things.

    $(window).load(function() {
      setTimeout(()=> $('[data-recent-activity-seemore]')[0].click(), 200);
    });

    0
  • Brett - Community Manager
    Comment actions Permalink

    Thanks for taking the time to share this with everyone Jason!

    0

Please sign in to leave a comment.

Powered by Zendesk