Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1248571
    Paul R
    Moderator

    Hi,

    Please add the code below in Custom > Edit Global Javascript.

    
    function getUrlParameter(sParam) {
        var sPageURL = decodeURIComponent(window.location.search.substring(1)),
            sURLVariables = sPageURL.split('&'),
            sParameterName,
            i;
    
        for (i = 0; i < sURLVariables.length; i++) {
            sParameterName = sURLVariables[i].split('=');
    
            if (sParameterName[0] === sParam) {
                return sParameterName[1] === undefined ? true : sParameterName[1];
            }
        }
    };
    

    Hope that helps.

    #1248623
    sandra.i
    Participant
    This reply has been marked as private.
    #1248721
    Lely
    Moderator

    Hi There,

    Are you referring to 3 other buttons on the right sidebar? If yes, we just need to add the correct link for those menu. If not please clarify which buttons on what page.

    #1248738
    sandra.i
    Participant

    Hi

    Yes exactly those buttons

    #1248829
    Joao
    Moderator

    Hi There,

    Based on your comment I am not sure if you managed to solve the issue.

    If you need further help please let us know.

    Thanks

    Joao

    #1248857
    sandra.i
    Participant

    Yes still need help with coding those buttons, thank you

    #1249571
    Lely
    Moderator

    Hello There,

    Please update the javascript to this:

    (function($) {
    	var menu = $('#lab_tests_sidebar'), 
    	target = $('#started_target');
    	var section = getUrlParameter('section');
    	if (window.location.search.indexOf('section=cdsa') > -1) {
    		target.load("http://www.rochesterclinic.co.uk/clinic/lab-tests/cdsa/" + " .entry-content.content");
    	}
    	if (window.location.search.indexOf('section=adrenal') > -1) {
    		target.load("http://www.rochesterclinic.co.uk/clinic/lab-tests/adrenal/" + " .entry-content.content");
    	}
    	if (window.location.search.indexOf('section=oat-test') > -1) {
    		target.load("http://www.rochesterclinic.co.uk/clinic/lab-tests/oat-test/" + " .entry-content.content");
    	}
    	if (window.location.search.indexOf('section=female-hormones') > -1) {
    		target.load("http://www.rochesterclinic.co.uk/clinic/lab-tests/female-hormones/" + " .entry-content.content");
    	}
    
    $('#lab_tests_sidebar a').each(function() {
            var element = $(this);
            element.on('click touchend', function(e){
              console.log(element.attr('href'));
              target.load(element.attr('href') + " .entry-content.content");
              e.preventDefault();
            });
        });

    To access each page via URL something like this:

    http://www.rochesterclinic.co.uk/clinic/lab-tests/?section=cdsa
    http://www.rochesterclinic.co.uk/clinic/lab-tests/?section=adrenal
    http://www.rochesterclinic.co.uk/clinic/lab-tests/?section=oat-test
    http://www.rochesterclinic.co.uk/clinic/lab-tests/?section=female-hormones

    Hope this helps.

    #1249703
    sandra.i
    Participant

    yes that’s working perfectly, thanks!

    #1249785
    Paul R
    Moderator

    You’re welcome! 🙂

  • <script> jQuery(function($){ $("#no-reply-1246872 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>