Umbraco drop down list with content entered by admin - xpath dropdown? - umbraco

In Umbraco 6.1, I need to add a field to a Document Type that gets it's possible values from a list that an admin user can add to via the back end.
I figured I'd do this by creating a Developer/Data Type of type XPath DropDownList and have that point to a folder in my Umbraco content through the XPath Expression //Configuration/lookup-lists/course-availability. I've set the Type of Document and Value to Node Id/
This drop down list isn't displaying the SimpleTextItems that are within this folder (its empty).
Any ideas?

I believe you're looking to select content from a specific folder in your content-tree, is this correct? Look into the Multi-Node Tree Picker in this case as you can configure this pick 1-n nodes in any specific folder or type..
If the above is not what you're looking for, you might also check the uComponents dropdown that an admin with access to the Developer section can edit the 'pre-values'.
Whatever you're looking for exactly - some data type in the uComponents package is most likely the answer. If not (u'd be surprised!), you may have to code your own .

Your XPath is incorrect.
your Xpath should be something like (loads all existing documents with doctype:SimpleText and in first level of Umbraco tree)
$ancestorOrSelf/ancestor-or-self::*[#level=1]/SimpleText
Please take a look at here to see correct Xpath samples for your dropdownlist

Related

How to query stories without parent feature link?

In a given area path, I would to get the list of stories that does not have parent feature link. How should I write the query for it?
To achieve you could change the type of your query to the Work items and Direct Links query, then choose the option to pull back all work items without any matching links. The results will still be a flat list.
In the filters for top level work items, just add a filed to specify a detail area path and choose corresponding work item type.
More details please take a look at our official here: Use direct links to view dependencies
Hope this helps.

Suitelink Reference Table

I work with Wonderware software. One of the objects used to perform communication between Wonderware and the PLC is called Suitelink. In it, I have a table defined that has the name of one of my application fields on the left side and the name of the PLC tag providing its value on the right.
Once this saved and activated (deployed) the PLC tags will feed values in the field attributes to Wonderware.
Does anyone know where is this list saved in the system?
I am working at a web page and want to retrieve this list dynamically so I can have the page updated based on the current live value of the PLC tag being used.
I have looked in the database but could not find it.
C:\ProgramData\Wonderware\DAServer
Then within there you'll have several subfolders for your DA Servers. Open the subfolder to find a *.AAcfg file and your contents are in there in what looks like an XML format. You'll be hunting for all the <DeviceItem> tags

SaveDialog suggested filenames to match extension filter

When my program displays a SaveDialog to save a file I can use the Filter and Filter Index properties to restrict the files displayed to certain extensions. Also, when I set the DefaultExt property then, as the user types a filename, matching files in the folder are displayed as suggestions in a dropdown box and one can be selected with the mouse.
For example if the filter is set to "*.xml" then only filenames matching that extension appear in the the dialog list of files. But if the user type "Test", then you will get a dropdown list of suggestion files like:
TestA.doc
TestB.xml
Test123.pdf
TestX.xml
(if those files are present in the folder)
But I would like the suggestion list to only contain the files that match the filter, such as *.xml. Is that possible? The problem is that users can hit the wrong suggestion and save their file with the wrong extension.
TSaveDialog internally uses the IFileDialog interface of Windows. That interface doesn't offer any way in which to change how to filter files in suggestion dropdown text box of File Name field.
You can :
Implement own dialog from scratch
Use component like DexExpress which is not free
Check result of save dialog after execution of it and validate the user selection file and show proper message to user if the file is not valid

Search option in multi-select listbox document property

I am trying to create a multi-select list box document property with unique values in a column. But, I don't see a search box feature like in the default list box property.
Please advise as how should I include this option in the list box document property that I created.
For the default listbox filter, we can choose if the search option to be included or not (as shown in the screenshot below). Don't we have this option available for document property?
Thanks for your help!
You can use any Jquery Plugin (check here - Here or Here ) or any JS library like Check this .

Multi language, intelligent link conversion

I'm pretty new to Umbraco, so my question may turn out to be pretty simple, but I wasn't able to find any simple guide on it online.
I'm building a simple website with one domain and structure as follows
Content
- en
-- products
-- contacts
- cs
-- produkty
-- kontakty
and so on. My first question is: since I want to accomplish some nice results in SEO, I need to (i) assign meta language to contents of "en" and "cs" nodes, as well as some keywords. How should I do this?
Second: Say that in the future, I decide to add a new language, ex. Russian. So what I would need to do is to make a copy of the "en" node and its contents while the links included in the newly created copy should be rewritten to point at the copy and not the original (original would be /en/anotherpage, which should be rewritten to /ru/anotherpage). Is this possible?
Thanks,
Ondrej
You could build the content structure as a single root node and then have multiple Language homepage nodes directly beneath the content root.
To assign a language, you could create a custom datatype that simply displays all the .Net cultures, e.g. en-GB, fr-FR etc. Include that data type as a field on the language homepage document type and then output this value in the markup on the homepage and each descendant.
In the Language homepage document type, you can add a textstring property called 'umbracoUrlName'. You can then use this property to override the Url name. E.g. So you could call the page www.domain.com/en/ instead of www.domain.com/en/english-home/
With regards to duplicating the site at a later date, this is a difficult one. If the links are created using data types like the media picker and uComponent's multi node tree picker, then you will have no option but to inherit the links from the copied branch. However, if the links are created dynamically in the Razor or XSLT, then you should be able to make the links relative to the Language homepage or the current page. E.g. in XSLT getting the children of the parent language homepage would be something like $currentPage/ancestors-or-self::* [#level = '2']/child::* . In other words you can avoid hard coding links by using a clever bit of relative traversal.
This should give you a good start on creating multilingual sites in Umbraco
http://our.umbraco.org/wiki/how-tos/running-multi-lingual-sites-under-a-single-domain
If you was to create a Russian version in the future you would do exactly what you have mentioned above, its that easy.
To set the language meta data I would store this in a property on the langauge root node eg: /en/ to get the language page property from any page:
var langNode = new Node(int.Parse(node.Path.Split(',')[1]));
langNode.GetProperty("languageCode");
As for copying the English version to the Russian version and fixing all the links, I'm not aware of anything in umbraco to help you with this, you could write something yourself to find all the links and node references and fix them. you could use the relations API to keep track of what was copied from where to where. You'll need to be aware that you could end up copying nodes more than once.
If you don't have too much data, manually fixing links may be quicker.

Resources