FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

change to title name from id in url

Feed 1 posts, 2 voices

Avatar
0 posts

example
http://www.domain.com/products/15/

i get the domain url shown in above

the 15 is the id from catalog_category database.

how to change the url something like this
http://www.domain.com/products/abc/

or just add the title/name of products after the product id
http://www.domain.com/products/15/{title}

which of the part or page i have to modify to get the nicer domain url?

 
Avatar
541 posts

you will need to create a behavior for this kind of page. Check in the Archive plugin how it work for url modification.

or you can add it to the url when you generate the link:

<a href="<?php echo $this->url.'?id='.$this->id; ?>"><?php echo $this->title ?></a>

or in a foreach page :

<?php foreach($this->children() as $prod): ?>
    <a href="<?php echo $prod->url.'?id='.$prod->id; ?>"><?php echo $prod->title ?></a>
<?php endforeach; ?>