We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36426
    • 197 Posts
    Hi can anyone help me out with an anchor link I added here: http://www.boothamluxuryapartment.co.uk/#reviews

    For some reason it won't work. I've added it to the menu at the top and bottom of the site. If you click to a different page, then hit the Reviews anchor link it just jumps back to the homepage but not down at the anchor linked section...

    Thanks for any help with a fix smiley
      Yorkshire UK based hosting provider: https://www.simulant.uk
      • 38783
      • 571 Posts
      Unless I have missed something you have not specified a location for the #review tag to target.

      You need to add id="review" to the point on the page you wish to go to.

      Wikipedia do a lot of anchors if you want to look at something for reference.
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 17301
        • 932 Posts
        As Andy says ^

        You have:

        <a name="reviews"></a>


        It would need to be:

        <a id="reviews"></a>

          ■ email: [email protected] | ■ website: https://alienbuild.uk

          The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
          • 36426
          • 197 Posts
          Quote from: lkfranklin at May 14, 2018, 10:24 AM
          As Andy says ^

          You have:

          <a name="reviews"></a>


          It would need to be:

          <a id="reviews"></a>


          Hi thanks I've updated that much appreciated, but it still doesn't seem to be working sad
            Yorkshire UK based hosting provider: https://www.simulant.uk
            • 17301
            • 932 Posts
            If you disable javascript and try it then it does work. It looks like the JS you're using to pull in the reviews is causing the issue.


            Not sure what the fix is off hand but you are using a very old library version of jQuery so you could try placing in an updated version instead which may solve the issue:

            <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


            You could also try sticking this scroll to piece in, but I'm not confident this'll work if the default functionality isn't working for you.

            <script type="text/javascript">
            
            	$(document).ready(function($) {
            
                // Scroll to
                $('a[href^="#"]').on('click', function(event) {
                	event.preventDefault();
                	var target = $(this.getAttribute('href'));
                	if( target.length ) {
                		event.preventDefault();
                		$('html, body').stop().animate({scrollTop: target.offset().top -150 }, 1000);
                	}
                });
            
            });
            
            </script>
              ■ email: [email protected] | ■ website: https://alienbuild.uk

              The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
              • 38783
              • 571 Posts
              Does it work if you put the anchor in your reviews heading?

              <h3 id="reviews">Feedback & Reviews</h3>
                If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                email: [email protected] | website: https://andytough.com
                • 36426
                • 197 Posts
                Hi thanks. I updated jquery but it hasn't help.

                and adding the anchor id to the <h3> instead also doesn't work any better.

                It seems the page reloads whenever the "Reviews" link is clicked, so rather than pointing to that section on the page it reloads the page completely and the reviews widget script loads in fresh and interrupts things/conflicts with it...
                  Yorkshire UK based hosting provider: https://www.simulant.uk
                  • 17301
                  • 932 Posts
                  Ah ok I assumed you were trying to scroll to that section from another page. In that case you just need to edit the link from

                  <li><a href="reviews.html">Reviews</a></li>


                  to

                  <li><a href="#reviews">Reviews</a></li>
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 36426
                    • 197 Posts
                    Quote from: lkfranklin at May 14, 2018, 11:56 AM
                    Ah ok I assumed you were trying to scroll to that section from another page. In that case you just need to edit the link from

                    <li><a href="reviews.html">Reviews</a></li>


                    to

                    <li><a href="#reviews">Reviews</a></li>

                    Hi thanks, but it is wayfinder setting the reviews.html link up! I do want to scroll from the same page and from other pages to that anchor on the homepage... I set up a "weblink" in modx with a link to the anchor. So the weblink resource is the reviews.html which in turn links to index.html#reviews

                    I hope that makes sense, it won't seem to work though
                      Yorkshire UK based hosting provider: https://www.simulant.uk
                      • 3749
                      • 24,544 Posts
                      In the tag that produces the link, you might try doing it like this:

                      [[~[[+id]] &scheme="full"]]
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting