Implement Language Selector - umbraco

I have a site with two languages, en-GB and fr-FR. my site structure is as follows
Home
---en
------subpages
---fr
------subpages
i want to implement a Language selector so that a user can also select on the page he wants this page in English or French, any ideas how to implement that. i am using Umbraco 5
Regards n Thanks,
Sher

I thinks the best way to do it is to add to your document type a property (possibly dropdownlist data type), which will hold a special keyword for each document. For Instance:
create a doc type with property "keyword", that will be a master doctype for the rest of your document and when you create a new document, set the keyword to be whatever you want. Then you can search for the wanted page and navigate according to the keyword.

Related

Import Umbraco property editor

We have site where a user went to the Data Types, saw we had a Content Picker data type using "(Obsolete) Content Picker" (Umbraco.ContentPickerAlias) and changed it to Umbraco.ContentPicker2
Our code relies on the obsolete one currently and now he cannot set the content we want him to.
Is there a way to recreate/reimport the Obsolete property editor into Umbraco?
On the Data Types node you can click on the ... and create a 'New data type' - then select the obsolete one to create it again.
But in theory, I believe you could just do the opposite of what the user did, on the ContentPicker click edit and pick the property editor from the dropdown if available?
Within the umbracoSettings.config file, there is a property you can create/set to true that will make obsolete data types become available to use against data types
<showDeprecatedPropertyEditors>true</showDeprecatedPropertyEditors>

Umbraco, how to add onChange functionality on dropdown content backoffice?

I am having one document type which contains a dropdown list, I need to add a couple of things in it:
I need to display the Database table names in drop-down dynamically.
On the change of dropdown option, i need to display the selected table columns names in another drop-down.
Are above things possible by using only existing data types or it will require creating a custom template using razor syntaxes (if it is so then how the template will display directly in the back office content node?)
Can you please provide your views and any links for code/tutorials?
screen shot of content form
If this is for the back office, you will need to do it in HTML and Angular, with an API controller to handle the DB lookup stuff.
As far as I'm aware, there's nothing built in to do dropdowns that depend on each other, so you'd have to create a new DataType to do it.
The process is to long to detail here, but here are some useful links on creating custom DocTypes in Umbraco 7.
https://our.umbraco.org/documentation/tutorials/Creating-a-Property-Editor/
http://velstand.info/tips/umbraco/to-create-a-datatype-by-using-external-data-sources/
https://24days.in/umbraco-cms/2016/custom-property-editor-tutorial/

How can I create a dynamic URL to open a new form?

Do you have a recommendation for creating a dynamic URL on a form (to open another form in a new window):
I should use buttons and how I can to configure that?
I should use explanatory text and how I can configure that?
This will be become easier when RFE 2427 is implemented. For now, you can use the technique described in this answer.
In the context of that question, the URL comes from a property. For your case, you're not saying what logic determines the dynamic URL, but I imagine that you can implement it in XPath. If it is indeed the case, you can just replace the call to xxf:property('com.example.siteurl') by your own XPath.

XPage Localization Process: How to translate properties files in bulk?

We have a huge project with more than 100 Custom Controls and XPages in place and now we intend to provide the project in multiple languages.
Localization in XPages, provides this beautiful and a very simple way to convert the entire project in the other language via the properties file. However, in our case, many custom controls are kind of carbon copies of others and many of the translations/keywords are the same, it becomes kind of redundant to change the same thing again and again.
So the question is, is there a simpler approach, where we can probably do a bulk of translation together? Something, where we can export the entire translation as one file and import it back?
Any suggestion/help in the right direction would really be appreciated.
Don't use XPage's build-in localization. It might work for a first translation but it's very difficult to maintain after (a lot of) changes in XPages.
Use a managed Java bean instead.
It manages own property files and implements Map interface.
You'd use the bean to get a string usually with EL.
Example:
Get name's label with str['name'] for following entry in property file
name=Name
Use java.text.MessageFormat for messages with data.
Create a method like getMessage(String name, Object arg1) in your bean.
Example:
Get the message for a missing view in JavaScript with
str.getMessage('message.view.not.found', viewName) for following entry in property file
message.view.not.found=Could not find view {0}
Another approach would be to use manually created property-files
Here an example for two languages:
First of all you have to create the following two files under Resources/Files
messages.properties
global.welcome = Willkommen {0} auf meiner Webseite
messages_en.properties
global.welcome = Welcome {0} on my website
Now you can reference your message properties on every place in your code
<xp:this.resources>
<xp:bundle src="/messages.properties" var="resMessage"></xp:bundle>
</xp:this.resources>
<xp:text escape="true" id="cfUser" themeId="Text.User">
<xp:this.value><![CDATA[${javascript:I18n.format(resMessage['global.welcome'], sessionScope.commonUserName)}]]></xp:this.value>
</xp:text>

How to create a dictionary list type property for document type in Umbraco?

I am quite new to Umbraco. I want to create a new property in my document type. This property is a list which contains items like dictionary type which has a key and a value. User can select multiple of these. For example
My document type is "Product", The property I want to create is "Related Items". Each related item will have an name & a url.
Can someone please give me an idea how to do this?
Cheers
You can use the default data types of Umbraco for it: http://our.umbraco.org/wiki/reference/default-datatypes (The wiki doesn't seem updated, but an the ultimate picker will get you the result you need, for example) You can do this in the developer section, create a new one from the defaults and add it to your document type afterwards.
You can also build a custom one, wich is becoming more and more easy, but the approach of doing it is now different in the new umbraco 7 version. Which version are you using?

Resources