Arun Kumar
Arun Kumar

Reputation: 11

How to create Custom URL Slug in Cake PHP editable from backend

i would like to customize url slug from back end for my seo purpose. rigt now what is my status here in application means .

the url slug automatically detect title and set the title as it is

problem is i dont want this auto set url i just want to customize each and every post url

please guide me any one

  1. what all are the thing need to be add in view file for that

2 what all are the thing need to be add in controller file

  1. what all are the thing need to be add in model file for that

4, Database already have field in name of slug do i need to create any new ??

  1. how to conqure and setup all

please give me some solution

Upvotes: 0

Views: 1047

Answers (1)

Salines
Salines

Reputation: 5767

  1. Add in your db table slug field VARCHAR 255
  2. Add in your form slug field
  3. Save
  4. Use Html helper and create links with slug

    $this->Html->link(
    'title here',
    array('action' => ' view', $article['Article']['slug']));
    
  5. in Controller findBySlug

Upvotes: 1

Related Questions