partech / seo-friendly-url Goto Github PK
View Code? Open in Web Editor NEWModule that enables SEO friendly URL's for Sitecore items
License: Apache License 2.0
Module that enables SEO friendly URL's for Sitecore items
License: Apache License 2.0
Hi Ruud,
first of all, thank you for the great module. I've discovered a problem with the use of your module.
In your resolver you go on the assumption that all resolvable Items must be below the StartItem.
This is also reflected in your ItemResolver code.
The HttpRequestArgs args.Url.ItemPath property is by default composed of RootPath + StartItem + LocalPath.
The method ResolveItem is thus always called with StartItem in the path parameter.
The Problem is that in my current project all resolvable items are siblings of StartItem and not children.
To make your ItemResolver more generic, it requires a handling which calls the method ResolveItem with different or customized parameter values, when variable resolved equals null.
Btw, In Sitecore.Pipelines.HttpRequest.ItemResolver the handling of various ItemsPath is also implemented.
Right now I have the problem solved as follows: (ItemResolver.cs:107)
// Resolve the item with security disabled. // Security will be applied after an item has been resolved. using (new SecurityDisabler()) { resolved = ResolveItem(args.Url.ItemPath) ?? ResolveItem(Context.Site.RootPath + args.LocalPath); }
You know what I mean? Maybe you can implement the better.
Many greetings
Maik
When the property forceFriendlyUrl is set to true, the site alises are disabled, it would be nice to have aliases without a redirect when we want an alias for an item
Working with a legacy sitecore site. It would be nice if there "trailingSlash" checks if there is a trailing slash already and not add another one.
Hey Ruud. This module is great. It's the best solution I've seen so far for taking care of URL's in Sitecore.
So far I've used it on one Sitecore implementation but I had to make a small change in the code to allow URL's to accept trailing slashes.
ItemResolver.cs - Line 72
I changed the current line:
string[] itemNames = path.Split('/');
To this instead:
string[] itemNames = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
This was important when migrating from sites that were previously on WordPress since their URL structure usually has trailing slashes.
Thanks!
An example might be:
http://demosite/sitecore/content/home
(assuming you still have the home node from the base install)
This will cause the module to constantly loop between
http://demosite/en/sitecore/content/home?sc_lang=en
and
http://demosite/sitecore/content/home?sc_lang=en
It just keeps swapping between the two until the browser throws up
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.