1

I started the development of my first Joomla component a few months ago but I needed to stop, because other projects. Now I'm back to work.

The thing is, my component is displaying a list of items but I need to add some filters. It will be amazing if instead of loading the entire page, I just update the list (there are other items in the page: menu, footer, an image carrousel). I suppose the answer is Ajax.

My question is: How can I implement this filter system, without affect SEO (I know Google says it can crawl ajax, but I read in many places that the safest thing is to have two versions: One with Ajax and other without Ajax). Do I need to implement the render of the list twice? If so, the ajax render should return HTML code or something like a JSON representation of the items to be added and then, with javascript insert those elements where they should be.

All help will be really appreciated.

Thanks in advance

1

Now that you can change the URL with Ajax without loading the page, you will be able to get the best of both worlds!

You can have your Ajax code load content, and, you can change the URL based on the content. For example, if your ajax is loading "Books", then you can change the URL to yoursite.com/books (or whatever the URL should be)

Changing the URL can be done with: window.history.pushState

Of course, you will need to ensure that any URL you push to the browser is a crawlable URL.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.