Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
strapi-plugin-permalinks
Advanced tools
A plugin for Strapi CMS to enable permalinks for content types with nested relationships.
A plugin for Strapi CMS to enable permalinks for content types with nested relationships.
Kinda like WordPress, but not 👍🏻
yarn add strapi-plugin-permalinks@latest
property | type (default) | description |
---|---|---|
contentTypes | array ([] ) | An array of objects describing which content types and fields should use permalink features. |
contentTypes
An array of objects describing which content types and fields should use permalink features.
Each object in the array requires a uid
, targetField
, and targetRelation
props. The field name "slug" is recommended for the targetField
value because it represents the unique part of the URL path, but it is not required. Similarly, the relation name "parent" is recommended for the targetRelation
, but is not required.
Consider we have a Page
content type which has a title
field, a uid
field named slug
, and relation field named parent
with a "has one" relationship to other Pages
.
Let's configure the Page
content type to use permalinks.
module.exports = {
'permalinks': {
enabled: true,
config: {
contentTypes: [
{
uid: 'api::page.page',
targetField: 'slug',
targetRelation: 'parent',
},
],
},
},
};
Let's say we have a separate Example
collection and we want those entities to have a Page
as it's parent
? This is mostly handled automatically, except when related entities are synced, which needs one additional config option targetUID
to be in place.
module.exports = {
'permalinks': {
enabled: true,
config: {
contentTypes: [
{
uid: 'api::example.example',
targetField: 'slug',
targetRelation: 'parent',
targetUID: 'api::page.page',
},
{
uid: 'api::page.page',
targetField: 'slug',
targetRelation: 'parent',
},
],
},
},
};
Assign a parent relation to a page to automatically generate a URL path that includes the slugs of it's parent pages.
All child pages will automatically have their slug values updated when the slug of their ancestor changes. This extends down to all descendant pages.
Deleting a page that has children will orphan those child pages. The parent relation will be removed from the child pages but no other changes to their data will occur.
If orphaned pages exist, you will see their slug value in the content manger list view as a red label instead of plain text.
Editing the orphaned page will display a warning and an error message on the target field. From here you can assign a new parent or no parent at all. Upon saving, any children of the page will also update their target fields to reflect to new parent slugs.
Better conflict resolution regarding updated/deleted pages is on the roadmap.
FAQs
A plugin for Strapi CMS to enable a URL path field for content types with nested relationships.
The npm package strapi-plugin-permalinks receives a total of 126 weekly downloads. As such, strapi-plugin-permalinks popularity was classified as not popular.
We found that strapi-plugin-permalinks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.