Closed ebrenner-code closed 7 months ago
Just found about it too, I think it's gone, missing the feature for a customer.
Hi 👋 this had multiple reasons, as it most of the times needed additional custom implementation.
How to implement a (simple) slug solution:
In your /config/bootstrap.php
file (create one if not already existing) add the following code:
<?php
// add slug data to an article collection item
$app->on('content.item.save.before.articles', function(&$data) {
// add sluggified version of the title field:
if (isset($data['title']) && $data['title']) {
$data['title_slug'] = $this->helper('utils')->sluggify(trim($data['title']));
}
});
It seems setting slug: true in the latest version of cockpit has no effect. Was it removed as an option? What is the current suggested method for automatically creating slugs for content?