I was wondering if it's possible to use standard Umbraco data types in Umbraco, on category definitions and product definitions in uCommerce.
I was thinking of using the Multi-Node Tree Picker, we are using this on standard pages in the shop for picking some spot elements, and I would like to do the same on a category or product page, if possible.
On standard webpages in the store, I can do something like this.
I haven't used the datatypes myself - but on Umbraco 6 shops you are able to use umbraco-datatypes (i don't think this feature is ready for Umbraco 7).
Small guide from Jesper here:
Thanks, for the reference, I am now a step closer to get it to work.
I have done it like this, but I am insecure what to call in my foreach loop to get the actualXML foreach item, than just the items id´s
With this I can get the id´s there are selected:
@{ Category category = SiteContext.Current.CatalogContext.CurrentCategory; var contentElmProperty = @category.GetProperty("LeftContentElements", "da-DK"); var element = contentElmProperty.GetValue();
I am not sure what you are meaning by it seems like you are only missing a deserializing. Maybe you could show how my foreach loop should look like. The difficult partfor meisthatwe are inuCommercecontextandnotstandardUmbraco.
You can have both a uCommerce and a Umbraco context. Just add a category/catalog/product node in the umbraco tree, with the url used in uCommerce rewrite-rules (i can elaborate on that, if you want).
Regarding the multinodes:
Category category = SiteContext.Current.CatalogContext.CurrentCategory;
var contentElmProperty = @category.GetProperty("LeftContentElements", "da-DK");
var element = contentElmProperty.GetValue().ToString();
var nodes = uQuery.GetNodesByXml(element);
foreach(var node in nodes)
{
@node.Name
}
(Just by memory - maybe you can get some inspiration if it doesn't work out of the box)
Use standard Umbraco datatypes
Hi,
I was wondering if it's possible to use standard Umbraco data types in Umbraco, on category definitions and product definitions in uCommerce.
I was thinking of using the Multi-Node Tree Picker, we are using this on standard pages in the shop for picking some spot elements, and I would like to do the same on a category or product page, if possible.
On standard webpages in the store, I can do something like this.
Does anyone know if I can use the standard Multi-Node Tree Picker, and if how to get data out of it, when I am on a category page or product page.
Any help will be appreciated,
/Dennis
Hi Dennis
I haven't used the datatypes myself - but on Umbraco 6 shops you are able to use umbraco-datatypes (i don't think this feature is ready for Umbraco 7). Small guide from Jesper here:
http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/45005-How-to-configure-umbraco-datatypes-in-ucommerce
Hi Nicklaj,
Thanks, for the reference, I am now a step closer to get it to work.
I have done it like this, but I am insecure what to call in my foreach loop to get the actual XML foreach item, than just the items id´s
With this I can get the id´s there are selected:
This gives the output.
<MultiNodePicker type="content"><nodeId>4858</nodeId> <nodeId>4872</nodeId> <nodeId>4859</nodeId></MultiNodePicker>
But if I try something like this:
Visual Studio tells me that the element type object is not enumerable
Did you have any idea on how I get the XML instead of the Id´s
Any help will be appreciated,
/Dennis
Seems like you are only missing a deserializing.
Maybe something like this: http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets/get-values-from-ucomponents-multi-node-tree-picker-multiple-textstring Would return the nodes you are looking for?
Hi Nickolaj,
I am not sure what you are meaning by it seems like you are only missing a deserializing. Maybe you could show how my foreach loop should look like. The difficult part for me is that we are in uCommerce context and not standard Umbraco.
Hope you can help.
/Dennis
Hi Dennis.
You can have both a uCommerce and a Umbraco context. Just add a category/catalog/product node in the umbraco tree, with the url used in uCommerce rewrite-rules (i can elaborate on that, if you want).
Regarding the multinodes:
(Just by memory - maybe you can get some inspiration if it doesn't work out of the box)
Hi Nickolaj,
Thanks for you help, appreciate it.
And with your code I now get the name of the of the elements that there are selected.
So it works like it should.
/Dennis
is working on a reply...