Comments (6)
+1
This would be a great addition to Vorto. Planning to move with Vorto for a big project, and being able to opt-out from applying all cultures on an item level would be extremely helpful.
from umbraco-vorto.
It is already possible to filter which languages appear in the list, however you must do it using Umbraco methods. The vorto prevalue lets you choose whether to display all languages or languages in use, If you choose languages in use, you can then also provide an XPath statement to locate the nodes with the languages defined on them, However, these languages need to be defined via the built in hostsname feature, rather than your own custom property.
This is the exact reason why the XPath field was incorporated so that you could create multiple sites within one install using different languages but only display the languages relevant to each site.
@seankearney to be honest, I can't quite get my head around your example, so not sure if you are requiring something else, but what I've explained above is how I've implemented filtered languages in vorto so myabe it will answer your question anyway.
from umbraco-vorto.
Matt, I do understand how the XPath based filtering of languages works, but it doesn't help my scenario. Let me try to clarify the requirement.
We have a single content tree.
- Home
- About-Us
- Board-Members
- Contact-Us
We have three hostnames defined in umbraco to go to this single tree.
example.com
->
en-US
en-ca.example.com
->
en-CA
ja-jp.example.com
->
ja-JP
Using Vorto we are able to manage the content in those three languages/cultures and we are seeing the proper content based on the current culture when we navigate the site. All good.
Let us say that the we have a requirement that the Board-Members
page cannot be accessible in the ja-jp
culture. So, the item exists in the tree, but we want to prune it out from generated menus and totally prevent the page from being rendered in the ja-jp.example.com
domain.
Now, I understand that this isn't a Vorto issue. We can add a checkbox list
data type with some prevalues
of the cultures we have. Then, the editor would specify which cultures the item is available in. Then, leveraging some Umbraco events we can prevent the rendering of the Board-Members
page to the ja-jp.example.com
domain. All good.
However, there is a Vorto usability issue in that the editor is presented with the ability to translate to Japanese even though they specified that the Board-Members
item shouldn't be available to the ja-jp
culture. In my scenario, I'd like to have Vorto not show ja-JP
as an option for the Board-Members
item even though ja-JP
is configured with the Umbraco hostnames. In this example we are dealing with only three total languages and filtering one. In reality, we will have many more languages.
I hope this helps clarify my requirement.
from umbraco-vorto.
Ok, the issue sounds very specific to your requirements, however, maybe I can put an event in place to allow you to filter the languages yourself before they are passed to the view, this way you could implement your own custom logic to filter the list further at run time. Would that suffice?
Matt
from umbraco-vorto.
I think that could work!
from umbraco-vorto.
Just released version 1.2 which now includes a custom event so you can filter languages further. In an application handler, just do something like:
Vorto.FilterLanguages += (sender, args) =>
{
args.Languages.RemoveAll(x => x.IsoCode.Contains("da"));
};
args
contains a list of languages about to be returned, along with the CurrentPageId
and ParentPageId
(need both as CurrentPageId will be empty on initial page creation so usually best to work out the filter based on parent page) so just modify the list as you wish.
from umbraco-vorto.
Related Issues (20)
- Examine search failure for keywords after carriage return when textarea editor with vorto
- Feature request - ModelsBuilder in Vorto HOT 2
- Optimisation: Cache language files for Vorto properties HOT 3
- Our.Umbraco.Vorto.Web.PropertyEditors.VortoPropertyEditor+VortoPropertyValueEditor - Error converting DB value to String HOT 6
- umbraco deploy & vorto-ising existing properties HOT 4
- Votro TextString - fallback to show TextString value on website & backoffice HOT 3
- Vorto API cause blocking when many Vorto properties exist on a document type HOT 1
- Vorto with many rich text fields loses content
- Issue in nested content template HOT 2
- Vorto in SurfaceController HOT 6
- Support for Umbraco v8
- GetVortoValue returns null in 1.7.0 version HOT 11
- Dropdowns and checkboxes HOT 4
- GetVortoValue Doesn't Recurse (v1.7.1) HOT 3
- using Vorto in my custom Sections HOT 1
- VortoValueConverter throws NullReferenceException with trashed content/media item HOT 4
- Porting / reimagining for v8
- Suggestion: Split Vorto into two projects HOT 1
- Make the package more strongly typed (generic typed) HOT 1
- Recursive GetVortoValue -> NullReferenceException HOT 8
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 umbraco-vorto.