I'm totally new in silverstripe. My friend asked to change urls of his site that's currently uses silverstripe cms. Now urls are long and ugly, for example:
apie-mus/komanda/TeamMember/agne-semberaite
There're some nested pages in admin panel, the first part depends on apie-mus (about) page, it has a child komanda (team) page, and there's a list of persons. As I understand, person has a TeamMember model.
The task is to overwrite urls totally to just a last part without TeamMember etc, so it should be just /agne-semberaite. Is it possible?
I understand that this url has not any infrormation about the dataset where it should perform a search for 'agne-semberaite'. So it should be like a oversearch through all collections.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
that depends on how you nest your pages in the admin panel. If you take a child page and put it out in the root it will not have the parent names. The nesting is also controlled with how you designed your system to begin with. If the child page has to be under parent then I'm not sure if you can do this.
For examples all newsArticles should be under news page. www.mysite.com/news/myarticle
I can create the page under root so its www.mysite.com/myarticle if my code allows it. I don't know what dependencies you have.
Ok, is it possible at least remove ClassName from links (they are in english now)?
apie-mus/komanda/TeamMember/agne-semberaite should convert to apie-mus/komanda/agne-semberaite;
/veikla/kurybiniai-uzsiemimai/Course/afrikietiska-perkusija should convert to /veikla/kurybiniai-uzsiemimai/afrikietiska-perkusija.
I can't broke tree-structure to a list without parents because top menu and some content based on it. I don't know the reason of this dependency, although.
Are here any other people who bother about SEO or just uncomfortable sharing ugly long urls? I completed the task and now urls on the site are short and contain just the last part, URLSegment (there's error in case of doubles although). I didn't expect I should have written such rubbish code for this modern cms, but It happened - every 5 minutes it traverses all tables in database, collects URLSegment fields and creates cache with siteUrl<->myUrl compares. At the begining of framework/main.php it substitutes myUrl to $_GET'['url']'=siteUrl, and at the end - ob_get_contents and preg_replace all found urls back from siteUrl to myUrl.
I really hardly imagine that silverstripe does not have an option to add custom alias full url to any page.