Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Henrik Vincent 122 posts 616 karma points
    Nov 08, 2016 @ 13:59
    Henrik Vincent
    0

    Fetch content on click

    Hi there

    I'm creating a company site in which we show some client testimonials in a modal.

    The testimonials are stored in a folder in the root and shown on all pages.

    So I ran the page through Googlebot and a problem appeared, since the hidden testimonials are rendered by Googlebot, even though the content is actually not visible until a jQuery function is executed.

    So it got me thinking, that instead of having this content on all pages on load, would it perhaps be possible to run a macro which injects the code when an element is clicked?

    My structure is
    Root
    -Frontpage
    --Textpage1
    --Textpage2
    --Textpage3
    -Testimonials
    --Testimonial1
    --Testimonial2
    --Testimonial3

    Hope you guys can help me out, cus I know this would be a better solution SEO-wise.

    Thank you in advance
    Best
    Henrik

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Nov 08, 2016 @ 17:03
    Alex Skrypnyk
    1

    Hi Henrik,

    I'm not sure that understood you right -

    So I ran the page through Googlebot and a problem appeared, since the hidden testimonials are rendered by Googlebot, even though the content is actually not visible until a jQuery function is executed.

    Testimonials are rendered by Googlebot?

    Do you mean testimonials are rendered at page load but not visible for users until click?

    The best way to fix it is to use UmbracoApiControllers for getting data from Umbraco and render it after click via js.

    Do you have any experience in this?

    Should testimonials be indexed by google somewhere on the site?

    Thanks,

    Alex

  • Henrik Vincent 122 posts 616 karma points
    Nov 09, 2016 @ 15:17
    Henrik Vincent
    0

    Hi Alex

    Thanks alot for taking the time to help me out.

    To answer your question first. Yes. Googlebot renders the testimonials, though they are hidden on load. I have an "overlay" which is mirrored and placed behind the actual content of the page.

    When a button is clicked the whole page flips and the testimonials are shown instead of the main page content. I'm guessing it could have something to do with me using backface-visibility:hidden only and not display:none.

    Sadly I have no experience with ApiControllers, but then again, there's only one way to get that :)

    Yea the testimonials should be indexed, but preferably only on one page I created in which this "overlay" is placed as the main content, since having the same testimonials on every page isn't good for SEO.

    Best

    Henrik

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Nov 10, 2016 @ 16:31
    Alex Skrypnyk
    1

    Hi Henrik,

    Than of course you have to remove hidden content from each page - it will have few positive effects for your site:

    • pages will be smaller

    • rendering will be faster

    Next you have to create functionality of getting data just after pressing click button. If you haven't experience community can help you just ask with code examples of your existing system

    What js libraries are you using for ajax?

    Thanks,

    Alex

  • Henrik Vincent 122 posts 616 karma points
    Nov 14, 2016 @ 07:59
    Henrik Vincent
    0

    Thank you very much again Alex

    Yea. I'm aware of the benefits of limiting the amount of HTML on each page, which is also why I'd rather handle it by getting the content on click instead of on load.

    I'm using jQuery as my only JS lib.

    Best

    Henrik

  • Henrik Vincent 122 posts 616 karma points
    Nov 14, 2016 @ 11:48
    Henrik Vincent
    100

    So your suggestions, got me thinking the solution over.

    First off, I created a new doctype in which I inserted the macro which lists all the testimonials.

    After this I made a simple Ajax call, in which I fetched the content of that page.

    So ended up being pretty simple compared to what I expected.

    Thanks for your help, Alex

    /Henrik

Please Sign in or register to post replies

Write your reply to:

Draft