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
Page 1 of 1
Seo Url By Title
#2
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
http://www.yiiframew...sions/?tag=slug
http://www.joshuawin...urls-for-pages/
http://www.yiiframew...slug&type=forum
red
#3
Posted 09 November 2012 - 07:21 AM
redguy, 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
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
#4
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
#5
Posted 09 November 2012 - 06:25 PM
redguy, 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!
Share this topic:
Page 1 of 1

Help














