Yii Framework Forum: Seo Url By Title - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Seo Url By Title Rate Topic: -----

#1 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 09 November 2012 - 05:44 AM

Hi

I want to use the pages title to generate seo url link.

But the title may has spaces, & and other special characters and I want to replaced by "-" (according to seo url rules)


Is there function/or method in Yii to make that or I should write my own php function ?

Thanks
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#2 User is offline   Maciej Liżewski 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 842
  • Joined: 02-July 10
  • Location:Central Poland

Posted 09 November 2012 - 06:58 AM

did you tried to search it? there is a lot of ready manuals, forum posts and extensions:

http://www.yiiframew...sions/?tag=slug
http://www.joshuawin...urls-for-pages/
http://www.yiiframew...slug&type=forum
red
0

#3 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 09 November 2012 - 07:21 AM

View Postredguy, on 09 November 2012 - 06:58 AM, said:

did you tried to search it? there is a lot of ready manuals, forum posts and extensions:

http://www.yiiframew...sions/?tag=slug
http://www.joshuawin...urls-for-pages/
http://www.yiiframew...slug&type=forum


Yes I had found a few extensions but I want use native Yii function
Nevermind I have wrote my own function that is like with yiibehaviorsluggable functionality

Thanks :)
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#4 User is offline   Maciej Liżewski 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 842
  • Joined: 02-July 10
  • Location:Central Poland

Posted 09 November 2012 - 09:53 AM

there is no 'built-in' slug functionality because Yii is not just CMS system. However it is very easy to achieve this with extensions or with own coding, like in this manual: http://www.joshuawin...urls-for-pages/
red
0

#5 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 09 November 2012 - 06:25 PM

View Postredguy, on 09 November 2012 - 09:53 AM, said:

there is no 'built-in' slug functionality because Yii is not just CMS system. However it is very easy to achieve this with extensions or with own coding, like in this manual: http://www.joshuawin...urls-for-pages/


Thank you Redguy for your suggestion.
I know the Yii is not another CMS. I used CMS before turn to the Yii framework :)
I would like to generate automatically the url by title rather than to store by use title/content/meta tags/etc .. and one more field? the url path! (to many fields for one article!)

So the way I preferred was to generate the url by title replace spaces, & . and other special characters by '-' plus id of content

Then I manipulate the url in action of controller and check only for id, loading the appropriate model and everything works! :)
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users