Support with_front
option during CPT registration for custom permalinks
#457
Replies: 2 comments 1 reply
-
Great idea! We're testing a fix for this in #468. Screenshots available in that PR. |
Beta Was this translation helpful? Give feedback.
-
ACM 0.15.0 is out now and supports this feature via a setting on the edit model page. Untick “use front permalink base” and your ACM posts will no longer be prefixed by Note that you will also need to re-export blueprints after making this change. (The Also note that the setting does not appear on the create new model form by design — only on the edit model form. Existing models and new models are unaffected — they use front permalinks by default unless edited to remove them, consistent with WordPress defaults. |
Beta Was this translation helpful? Give feedback.
-
When using a custom permalink structure such as
/posts/%postname%/
, permalinks for ACM posts include the/posts/
prefix.For example, say I have a "rabbits" model. Rabbits are inherently different than "posts". However, the permalink I get for my newly created rabbit is:
http://headless.local/posts/rabbit/333
When I would expect it to be:
http://headless.local/rabbit/333
By supporting the
with_front
register_post_type()
option, this permalink structure can be supported.I believe this becomes increasingly important when dealing with frontend ui frameworks like Faust.js/Next.js/etc. that use file system based routing, as it would require you to have the following directory structure:
Instead of:
Matching WP permalink structure with your frontend url structure is valuable when considering sitemaps, and other features.
Beta Was this translation helpful? Give feedback.
All reactions