Git Product home page Git Product logo

Comments (10)

beporter avatar beporter commented on June 14, 2024

The slug is irrelevant on its own. The sitemap only cares about unique URLs and unique content.

Does each URL reference genuinely unique content, even if the slug part of the URL is the same for many URLs? Or do all 100 of those URLs with the same slug reference the same exact data?

The answer to that will determine whether you need to filter or not. Since you probably shouldn't have 100 identical pages with different URLs (bad for SEO), my guess is that you probably will want to list them all if they are unique. (Otherwise, why would you need 100 different URLs to get to the same page?)

from cakephp-sitemap.

nick-harper avatar nick-harper commented on June 14, 2024

The pages all have the same URL.

This is a different model called "searches"

The links for this are /search/keyword-term

Now when I show them normally I can either group them or just show unique, the sitemap is showing every instance rather than them being grouped.

from cakephp-sitemap.

nick-harper avatar nick-harper commented on June 14, 2024

In the model every single instance of the "search" has been saved as it is saved against users, dates and times. That way we can count how many there are, who has searched for it etc.

It also creates a page for that term going by the keyword so it is just a case of the sitemap only showing 1 for each keyword.

Almost like it needs to do a select and group by searchterm rather than getting EVERYTHING.

from cakephp-sitemap.

beporter avatar beporter commented on June 14, 2024

Okay, then it sounds like you need to make use of the conditions key to try to restrict which records are returned. This plugin might not be able to fully meet your needs here-- if you do end up needing to add a "GROUP" clause I don't think we provide a good way to do that.

from cakephp-sitemap.

nick-harper avatar nick-harper commented on June 14, 2024

Would the conditions be able to limit it to one instance of it?

I have tried an XML generator but that way just likes to send a bot onto each page to gather links 👎

from cakephp-sitemap.

beporter avatar beporter commented on June 14, 2024

For our own reference: We'd probably want to change this to allow for an entire $options array to be provided (with a default recursive = -1 added to it if that key is not already present) instead of just the conditions key.

from cakephp-sitemap.

beporter avatar beporter commented on June 14, 2024

@nick-harper Probably not. At least, I can't think of an inventive way to do it only in the WHERE part of the query.

from cakephp-sitemap.

nick-harper avatar nick-harper commented on June 14, 2024

Damn :( I guess I will just need to use a generic generator.

Thanks very much for your help.

from cakephp-sitemap.

beporter avatar beporter commented on June 14, 2024

Feel free to issue a PR for the change I mentioned earlier. It's a logical improvement to make. Thanks for your feedback, in any case.

from cakephp-sitemap.

justinyost avatar justinyost commented on June 14, 2024

Just for reference created an issue associated with the suggested change of being able to pass the full options back to the generateSitemapData method: #12

from cakephp-sitemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.