How do I remove the "Join My Team" button on a TeamRaiser personal page?

Options

We have TeamFunctionality enabled, but it's hidden to the user. There is a new "Join My Team" button under the donate button on the personal page, and I need to hide it. Tried this JavaScript but it didn't work...because I don't know what I'm doing. Help!

 

<script type="text/javascript">

addOnLoadHandler(function(){

     if(document.getElementById('cstmBtnBack'))

          document.getElementById('cstmBtnBack').parentNode.parentNode.style.display='none';

});

</script>

Tagged:

Comments

  • Have a link?

  • Lindsi Gish:

    Sorry, that might be helpful. :smileyhappy:

     

    http://www.2harvest.org/site/TR/Events/FoodandFundDrives?px=1399304&amp;pg=personal&amp;fr_id=1050

    Nice looking design.

     

    I notice that 'cstmBtnBack' is a CLASS, not the ID.

     

    Perhaps you could get this with CSS instead.

     


    .cstmBtnBack {



        display none;



    }

     

  • Brian Mucha:

    Nice looking design.

     

    I notice that 'cstmBtnBack' is a CLASS, not the ID.

     

    Perhaps you could get this with CSS instead.

     


    .cstmBtnBack {



        display none;



    }

     

    Otherwise, Jquery has some ways to select an item using CLASS, which I think would look something like this...

     

    $('.cstmBtnBack').parent().parent().css('display', 'none');

  • Brian Mucha:

    Otherwise, Jquery has some ways to select an item using CLASS, which I think would look something like this...

     

    $('.cstmBtnBack').parent().parent().css('display', 'none');

    The CSS code you gave hides the button but not the link below it (which doesn't appear to have an ID or class, just a table row). And is this how I'd put in the JQuery code? (I don't know anything about JavaScript or JQuery.



    <script type="text/javascript" src="jquery.js">

    $('.cstmBtnBack').parent().parent().css('display', 'none');

    </script>

     

    Thank you for your help!

  • Kent Gilliam
    Kent Gilliam Blackbaud Employee
    Ancient Membership Facilitator 4 Name Dropper Photogenic
    Lindsi Gish:

    The CSS code you gave hides the button but not the link below it (which doesn't appear to have an ID or class, just a table row). And is this how I'd put in the JQuery code? (I don't know anything about JavaScript or JQuery.



    <script type="text/javascript" src="jquery.js">

    $('.cstmBtnBack').parent().parent().css('display', 'none');

    </script>

     

    Thank you for your help!

    After chasing down an javascript guru we were able to get the code to do what Lindsi needs. I'm sharing here in case anyone else ever needs this.

     

    Here’s the code to remove the two references to “teams” as the community thread mentions. Our WebDev guy Eric used standard JavaScript and our Utils.js addOnloadHandler function, so you don’t have to understand jQuery. Also, Eric included some conditionals so this can be thrown into the page wrapper META field, and it will only execute on TR Personal pages on the TR with ID 1050. (this can be modified based on another TR ID)

     


    [[?x1050xpersonalx::x[[S334:fr_id]]x[[S334:smileytongue:g]]x::
    <script type="text/javascript">
    <!--
    function hideTeamLinks(){
    var allLinks = document.getElementsByTagName('a');
    for (var i = 0; i < allLinks.length; i++){
    if ((allLinks[i].innerHTML.indexOf('Join ') != -1 && allLinks[i].innerHTML.indexOf(' Team!') != -1) || allLinks[i].innerHTML.indexOf(' team page') != -1){
    allLinks[i].parentNode.style.display = 'none';
    }
    }
    }
    addOnLoadHandler(hideTeamLinks);
    //-->
    </script>
    ::]]

     

     

     

     

Categories