How do I best create many to many relations in Umbraco? Options
tkahn
Posted: Sunday, February 24, 2008 5:44:40 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Say that I have a website about coffee and cookies. The central part is recepies for cookies and recepies (or rather preparation instructions) for different kinds of coffee (latte, macchiato, espresso, lungo etc).

On a page with preparation instructions for a certain kind of coffee I want to list 1 -> N number of links to pages with recepies for cookies. And on the pages with recepies for cookies I want to be able to list 1 -> N number of tips for coffee types that work well with this particular coffee.

What would be the smartest and easiest way to make it possible for the administrator to create these cross references.

Thanks in advance!

/Thomas K

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Sunday, February 24, 2008 5:47:04 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Thomas Kahn wrote:

And on the pages with recepies for cookies I want to be able to list 1 -> N number of tips for coffee types that work well with this particular coffee.


This should of course be:

And on the pages with recepies for cookies I want to be able to list 1 -> N number of tips for coffee types that work well with this particular cookie.


Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
drobar
Posted: Sunday, February 24, 2008 6:50:28 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,696
Location: KY, USA
Hi, Thomas,

Check out the "Multiple Page Picker via Source" control that was originally created by Christian Palm, and later updated by Morten Bock (that's the one I've used) and more recently by Ismail Mayat (though I don't know if it is build on Morten's update or on Christian's original code).

Multiple Content Picker (aka, Multiple page picker via source)
http://www.cpalm.dk/blog/2006/03/29/multiplepagepickerviasource.aspx
Updated by Morten, June 2007:
http://www.mortenbock.dk/updated-cpalm-multiple-page-picker-for-v3-bugfix-57.htm
Updated by Ismail, August 2007:
http://ismail.umbraco.net/2007/8/31/update-to-multiplepagepickerviasource.aspx

cheers,
doug.




MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
tkahn
Posted: Sunday, February 24, 2008 7:33:06 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Yes! That's exactly what I ment!
Thanks Doug!

Before I started using Umbraco as a base for most of the websites I build, I used to code a lot using relational databases and sometimes I miss some of the features that are available in them. One such thing is one-to-many and many-to-many relations.

/Thomas

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Monday, April 21, 2008 11:08:18 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Tried Christian Palm's MultiplePagePickerViaSource and it works like it's intended.

The problem is that I want to be able to select pages that are distributed over several mother nodes and this add-on is restricted to only one "mother node". I would rather have it present a list of selectable content (pages) based on the Document Type of the page, regardless of which mother node these pages have. Is there another add-on that does this?



Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
imayat12
Posted: Monday, April 21, 2008 11:21:40 AM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
tkhan,

The link to my blog has a full tree version however i recommend you use the excellent control by lefteris much better ui get it here please note this only works with v3

Level 2 certified. If it aint broke dont fix.
tkahn
Posted: Monday, April 21, 2008 11:27:28 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
imayat12 - a million thanks!
I have used Lefteris Multiple Media Picker on many other sites and it's great. I'm thrilled to see that there is a Node Picker as well!

Will try it out now!

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Friday, April 25, 2008 9:18:40 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Hmm, it's not working at all. I install the three files in the package like instructed and I try creating a new data type. But when I try to access the data type I get this error:

Code:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
   lefNodePicker.lefNodePickerPreValue.get_Configuration() +334
   lefNodePicker.lefNodePickerPreValue.OnLoad(EventArgs e) +101
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


I have mailed Lefteris about this but I haven't yet recieved a reply and since my deadline is awful close I thought I'd check with the Umbraco community to see if anyone else has stubled across this error.

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Friday, April 25, 2008 9:45:32 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Found a workaround for my problem. Here's what I did:

1) Remove the files associated with Lefteris Multiple Node Picker from your Umbraco installation (lefNodePicker.dll, lefTreeInit.aspx and the ext-1.1 folder).

2) Create a new data type named "Lefteris Multiple Node Picker" but use the regular Member Picker as the rendercontrol. Save the new data type.

3) Move the files back in to your Umbraco installation.

4) Edit the data type you just created (Lefteris Multiple Node Picker) and change its rendercontrol to "lef Multiple Node Picker". Save.

This seems to work fine and I have succeeded in using the new datatype in one of my templates. I haven't tried using it yet though (selecting nodes in the admin and listing them using XSLT).

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
naho
Posted: Friday, June 13, 2008 4:52:00 PM
Rank: Newbie

Joined: 5/30/2008
Posts: 21
Location: USA
Hi Thomas
The workaround you suggested worked but if I need to create any new data type after intalling files associated with Lefteris Multiple Node Picker, I still get the same error. Did you have this problem?

Thanks

naho
tkahn
Posted: Saturday, June 14, 2008 1:25:39 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
naho wrote:
Hi Thomas
The workaround you suggested worked but if I need to create any new data type after intalling files associated with Lefteris Multiple Node Picker, I still get the same error. Did you have this problem?

Thanks

naho


Yes, I remember having the sam problem.
It would be interesting to know what's causing this and how to fix it.

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.