Apologies if my terminology isn't quite on track here but I'll try my best...
Think of the following case where a "Country" is within a "Region". For example, UK resides within Europe and Australia resides with Oceania.
To achieve this structure in Umbraco, I understanding in Umbraco that I can either:
A) On a "Country" document; add a ContentPicker2 to select he country's "Region".
B) On the "Region" document; add a MultiNodeTreePicker2 to select multiple "Countries".
My specific question is; does Umbraco include the means for this selection to be made from both the "Country" and the "Region" using the same underlying data (which I assume is a many-to-many link within the database).
I've tried looking through the documentation and support forums but cannot find the answer - sorry.
The reason that I want to be able to administer the data (via the CMS) from both ends is ease-of-use for the client.
For example, say if the nodes in question are staff and office (i.e. a member of staff resides within a single office). When setting up a new office it would be great to pick staff from a multinodetreepicker, right? But, in the case where an existing staff member moves office; you really want to go to the staff member CMS page and change their office from a single picker?
I only attempted to provide a practical example because it was more pertinent to the second example - sorry.
Home
|____ Region
|___ Country
That's my document structure;
On Regions I have a multinodepicker of Countries where the CMS admin can select one or more countries within a region.
This is absolutely fine and on the front-end I have absolutely no problem getting a Region for a Country in code.
If the CMS admin visits a Country in in the back-end then they cannot see or change the Region for that Country since the relationship only exists on the Region node.
Yes I understand it completely, that's why I suggested the other solution in my first post. Then you don't have this problem and you don't need any single or multi content pickers.
The only thing you have to do is create a region node and allow country nodes to be added as children.
Below you can find a simular example in one of our projects:
So we have a country België and Nederland which have child cities.
Then on the België we use:
var cities = Model.Content.Children;
to have a list of all cities in België.
Then on the for example Brugge content node, we use:
We've used that technique in the past and your suggestion makes complete sense buddy, thank you :)
I guess that I was only using that as an example and the second example of staff and offices may be more pertinent.
We could use the same node/child-node solution you have given here but we would lose in other areas; like the ability to use a single list-view to see all items across all parents. Not the end of the world, but I'm just trying to ascertain what's possible with this excellent CMS.
I'm gonna have a go with the relations thing like Ismail suggest.
We've used that technique in the past and your suggestion makes complete sense buddy, thank you :)
I guess that I was only using that as an example and the second example of staff and offices may be more pertinent.
We could use the same node/child-node solution you have given here but we would lose in other areas; like the ability to use a single list-view to see all items across all parents. Not the end of the world, but I'm just trying to ascertain what's possible with this excellent CMS.
I'm gonna have a go with the relations thing like Ismail suggest.
Two-way, Many-to-Many links between documents...
Hi Guys,
Apologies if my terminology isn't quite on track here but I'll try my best...
Think of the following case where a "Country" is within a "Region". For example, UK resides within Europe and Australia resides with Oceania.
To achieve this structure in Umbraco, I understanding in Umbraco that I can either:
A) On a "Country" document; add a ContentPicker2 to select he country's "Region".
B) On the "Region" document; add a MultiNodeTreePicker2 to select multiple "Countries".
My specific question is; does Umbraco include the means for this selection to be made from both the "Country" and the "Region" using the same underlying data (which I assume is a many-to-many link within the database).
I've tried looking through the documentation and support forums but cannot find the answer - sorry.
Thanks in advance,
Splinx :-D
Hi Splinx,
another solution could be creating a parent
Region
node that containsCountry
childnodes.Then you have a nice structured way and then you can use easy queries for getting the two-way binding.
Get all children on a region page:
Get the region on a country page:
Hope this helps.
/Michaël
Thanks Michaël,
yeah, I've got that in place already...
The reason that I want to be able to administer the data (via the CMS) from both ends is ease-of-use for the client.
For example, say if the nodes in question are staff and office (i.e. a member of staff resides within a single office). When setting up a new office it would be great to pick staff from a multinodetreepicker, right? But, in the case where an existing staff member moves office; you really want to go to the staff member CMS page and change their office from a single picker?
Am I making sense here?
Thanks,
Splinx :-D
Hi Splinx,
its kind of confusing because first you talk about Regions and Countries and now Staffs and Offices!
That at a side node.
Maybe you can show your current content node structure with a screenshot? Then we can have a better view and understanding.
/Michaël
Hi Michaël,
I only attempted to provide a practical example because it was more pertinent to the second example - sorry.
That's my document structure;
On
Regions
I have a multinodepicker ofCountries
where the CMS admin can select one or more countries within a region.This is absolutely fine and on the front-end I have absolutely no problem getting a
Region
for aCountry
in code.If the CMS admin visits a
Country
in in the back-end then they cannot see or change theRegion
for thatCountry
since the relationship only exists on theRegion
node.Are you with me?
Cheers,
Splinx
Yes I understand it completely, that's why I suggested the other solution in my first post. Then you don't have this problem and you don't need any single or multi content pickers.
The only thing you have to do is create a region node and allow country nodes to be added as children.
Below you can find a simular example in one of our projects:
So we have a country
België
andNederland
which have child cities.Then on the
België
we use:to have a list of all cities in
België
.Then on the for example
Brugge
content node, we use:to have the country of the city.
Hope this helps.
/Michaël
Oh yea, I get ya :)
We've used that technique in the past and your suggestion makes complete sense buddy, thank you :)
I guess that I was only using that as an example and the second example of staff and offices may be more pertinent.
We could use the same node/child-node solution you have given here but we would lose in other areas; like the ability to use a single list-view to see all items across all parents. Not the end of the world, but I'm just trying to ascertain what's possible with this excellent CMS.
I'm gonna have a go with the relations thing like Ismail suggest.
Thanks again buddy :-D
Kind regards, David
Oh yea, I get ya :)
We've used that technique in the past and your suggestion makes complete sense buddy, thank you :)
I guess that I was only using that as an example and the second example of staff and offices may be more pertinent.
We could use the same node/child-node solution you have given here but we would lose in other areas; like the ability to use a single list-view to see all items across all parents. Not the end of the world, but I'm just trying to ascertain what's possible with this excellent CMS.
I'm gonna have a go with the relations thing like Ismail suggest.
Thanks again buddy :-D
Kind regards, David
Splinx,
You can create relations and use relations package.
https://our.umbraco.org/projects/backoffice-extensions/umbraco-relation-editor/
https://our.umbraco.org/Documentation/Reference/Management/Services/RelationService
Regards
Ismail
Thank you Ismail,
I will look into this plugin and see if I can work it all out.
I'll report back either way.
You guys rock!
SplinX
is working on a reply...