2 Replies Latest reply: Jul 8, 2013 5:37 PM by Liam Dilley RSS

    Ajax site crawlable with escaped fragments

    thetrickster888 Community Member

      So-- I was wondering if anyone had ideas on how to comply with Google Webmaster tools' ajax crawlable solution on BC.  I know you can use tools that use ajax, pushState(), history and hashbang URL's like jQuery BBQ to create a fully ajax site: http://benalman.com/code/projects/jquery-bbq-dev/examples/fragment-ajax-crawlable/

       

      But Google's webmaster tools suggests that there's a fallback for bots to crawl the site using the "_escaped_fragment_" URL parameter to serve up that hashbanged URL's content for robots to crawl as outlined here: https://support.google.com/webmasters/answer/174992?hl=en

       

      If we had site-wide access to liquid markup at this point it might be accomplished in conjunction with the URL module like so:

       

      {% assign page_fragment = "{module_url,_escaped_fragment_}" %}

       

      {% if page_fragment == 'contact' %}

      My contact content

      {% else %}

      My homepage content

      {% endif %}

       

       

      Boy was I really hoping for liquid markup to be implemented but is that even on the roadmap anymore? Does it only work in custom product module templates?

        • 1. Re: Ajax site crawlable with escaped fragments
          thetrickster888 Community Member

          If we can't use escaped fragments then I guess the solution to ajaxable content would be to have your links default to URLs for the actual rendered page content and use javascript to update those links to link to hashbanged URLs for ajax using jQuery BBQ or similar on page load.

          • 2. Re: Ajax site crawlable with escaped fragments
            Liam Dilley CommunityMVP

            Avoid hashbang etc if you can like the plague.

            You probably notice that big sites and systems that have used this such as twitter have all scrapped that. It was a bit of a fad but the perfomance issues and useability issues this concept creates outways any other advantages. If your building a web application it has some validatity still for sure, but anything other then a marketing very advertisy/visual site promoting a product for example, I would really avoid using this.