Comments (6)
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.
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.
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.
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.
Released in v2.0.0 for the Strapi v4 version of strapi-plugin-sitemap
.
from strapi-plugin-sitemap.
@boazpoolman so, right now we can use slug
for create the sitemap, right?
from strapi-plugin-sitemap.
Related Issues (20)
- Update dependencies to mitigate vulnerabilities HOT 1
- Not working with strapi 4.11.5 HOT 2
- Support excluding sites by condition HOT 2
- how to exclude a specific url for sitemap HOT 9
- Allow URL translation sets for custom URLs HOT 2
- How to combine multiple content-types? HOT 2
- Server.js configuration for the sitemap plugin HOT 12
- Error when generating sitemap on Strapi 4.14.4 and Node v18 HOT 2
- Multiple hostnames/host profiles HOT 1
- Critical dependency: the request of a dependency is an expression HOT 5
- Allow relational fields be declared in url patern recursively HOT 3
- Bug: excludedTypes config setting doesn't seem to work HOT 5
- Bug: missing settings labels HOT 5
- Make the <xhtml:link> element in XML optional HOT 1
- feature request: pretty print option HOT 6
- Feature Request: i18n `prefix_except_default` strategy HOT 8
- Sitemap Breaks When Exceeding Limit and Strapi Port Differs from Default HOT 4
- Add an additional link tag with hreflang x-default to improve locale detection fallback HOT 5
- Does not work with ADMIN_PATH and STRAPI_ADMIN_BACKEND_URL HOT 1
- Add extension points / hooks. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strapi-plugin-sitemap.