Title and Slug question (SEO)

Hi,

Haven’t had time to test but I’m wondering if I can create my own slug instead of the autogenerated one?

For example, I have a blog, with a blogpost. The title of the blogpost is let’s say “The 10 cutest cats on the internet that will put a smile on your face”.

What I need is to have one field for the title and one field for the slug. They should be totatlly separate from one another.

So in this case the title would be “The 10 cutest cats on the internet that will put a smile on your face” and for the slug I would remove some words and would look like this: “10-cutest-cats-on-the-internet”

In other words I want to control these two fields manually, individually.

Is this possible and how?

Do you use the blog sample? If the answer is yes:

  1. Enable the slug field and rename it (remove the autogenerated).

  2. Click to 3 dots in the schemas view and go to the scripts. You can either remove the create and update script, or you change it to:

         var data = ctx.data;
         
         // Create the slug only if the title has been set and the the slug has not been set
         if (data.title && data.title.iv && (!data.slug || !data.slug.iv)) {
             data.slug = { iv: slugify(data.title.iv) };
         }
    
         replace(data);

Thanks, this worked.