Comments (5)
Sure! What @Steve-Fenton says is correct, however, there is another, slightly more elegant solution: to utilize the CultureInfo.CurrentUICulture.Name value in the CustomContentLinkUrlResolver.
The culture is being set in the LocalizedMvcRouteHandler and is then used by the ControllerBase class. It can be therefore used in the same way in the link resolver.
The most-elegant solution is to enrich the ContentLink class in the SDK with a notion of the culture.
Fixed via #62 and filed an issue in the SDK repo.
from sample-app-net.
Should this be fixed in the content, or by adding additional routes?
It could be solved by adding routes to catch all situations where there is no language in the URL - one would be needed for each localized route. Otherwise, the link in the content (which is an en-US page) could be updated to point at the en-US route: /en-us/articles/on-roasts
routes.MapRoute(
name: "ArticleNoLang",
url: "articles/{urlSlug}",
defaults: new { language = LanguageClient.DEFAULT_LANGUAGE, controller = "Articles", action = "Show", urlSlug = "" }
);
from sample-app-net.
@JanLenoch could you please comment on that?
from sample-app-net.
Hi guys, I found other broken links in the "Coffee processing techniques" article that lead to "Page not found". Both of them are leading to coffee products: Kenya Gakuyuni AA and Brazil Natural Barra Grande.
I guess the problem might be in the CustomContentLinkUrlResolver.cs since it links products via $"/products/{link.UrlSlug}"; Also, the lang codename doesn't match.
Currently used link: /en-US/products/kenya-gakuyuni-aa
Correct link: /en-us/product/detail/kenya-gakuyuni-aa
See it here: https://dancing-goat-mvc-develop.azurewebsites.net/en-US/products/kenya-gakuyuni-aa
from sample-app-net.
Well spotted, @MartinaFarkasova ! Pushed 47ec62a to finish the fix.
from sample-app-net.
Related Issues (20)
- Spike: Try deploy to zeit HOT 6
- Migrate the application to ASP.NET Core MVC HOT 11
- Error on build inheriting ICodeFirstTypeProvider in DancingGoat.Models HOT 2
- Replace hardcoded sample project items count in SelfConfigController.
- After deploying to Azure, the app returns 500 Internal server error. HOT 3
- Extract HTML helpers (edit mode panel, etc.) to a separate library HOT 13
- Unable to Deploy to AWS Bean Stalk from Bamboo HOT 1
- Localized URLs don't return expected localized pages HOT 4
- Edit Model Panel target=_blank links should have rel="noopener" added HOT 1
- Self config still shows Kentico Cloud logo HOT 1
- Building sample app on Mac OS HOT 3
- Add an example of the languages endpoint usage
- CI Build fails for PRs outside of this repo HOT 2
- Use smart-link SDK instead of custom made tag helper HOT 1
- Fill Spanish resource file
- Switching the language does not preserve current route
- Css file is missing HOT 1
- Deprecated packages upgrade HOT 1
- Use Environment ID instead of Project ID
- Include information about the "Generate Models" PS script on build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-app-net.