Coder Social home page Coder Social logo

Comments (6)

boazpoolman avatar boazpoolman commented on May 9, 2024 2

Hey @SalahAdDin

In strapi-plugin-sitemap ^2.0.0 you can use URL patterns.
In the pattern you can inject dynamic values.
Those can be ID's, UID's or any other field type.

See documentation here:
https://github.com/boazpoolman/strapi-plugin-sitemap#-url-pattern

from strapi-plugin-sitemap.

boazpoolman avatar boazpoolman commented on May 9, 2024

I think the best approach here would be to set a 'URL pattern' for each collection type you add to the sitemap.
This would be a text field in which you can inject some dynamic values based on the fields of the collection type.
Doing this, we could remove the 'area' field, as you can just add a prefix in the URL pattern field, which will simplify the form all together.

Example value:
/[langcode]/some-prefix/[some-category-field]/[some-uid-field]

I'm not sure as to which field types we should allow here other than id and uid fields. Seems like it would be handy to allow a relationship field like category, but how will we then specify which field of the category type we should use in the URL? Something to think about.

from strapi-plugin-sitemap.

boazpoolman avatar boazpoolman commented on May 9, 2024

Regarding the inclusion of relationship fields in the URL I'd suggest for now at least we also only allow the ID and UID type fields of the relationship. This way we will ensure the URL will consist only of fields which are actually usable in a URL (no spaces e.g.).

from strapi-plugin-sitemap.

boazpoolman avatar boazpoolman commented on May 9, 2024

This is now in the develop branch, will be released with the next minor/major release.
You are able to test this like so:

yarn add boazpoolman/strapi-plugin-sitemap#develop
npm install boazpoolman/strapi-plugin-sitemap#develop

from strapi-plugin-sitemap.

boazpoolman avatar boazpoolman commented on May 9, 2024

Released in v2.0.0 for the Strapi v4 version of strapi-plugin-sitemap.

from strapi-plugin-sitemap.

SalahAdDin avatar SalahAdDin commented on May 9, 2024

@boazpoolman so, right now we can use slug for create the sitemap, right?

from strapi-plugin-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.