![]() |
|
|
|
|
#1
|
|||
|
|||
|
OK, here's the scenario: I've been asked to develop a new site for Ford Motor Co. (yeah riiiiight!).
I have a definition of 'Car' (Fiesta, Focus, Mondeo etc.). 'Car' is a parent definition of 'Model' (1.2 Popular, 2.0 Sport etc.). 'Model' is a parent definition of 'Colour'. I have populated 'Colour' with Red, Blue, Green, Yellow, Black, White & Silver. Now I want to display a content page for each 'Model' which will include the colours available. However, a 1.2 Popular is only available in Red, Blue and Yellow, a 2.0 Sport in Red, Blue, Black and Silver etc. Have I set up my relationships correctly, and if so how do I specify within the content entry for a 'Model' which colours are available, and how would I then display them on a content page? Is this even possible? |
|
#2
|
|||
|
|||
|
If I was doing it, I wouldn't have the colour as a separate definition, but would instead have it as a content element of Multi-Defined List - then have a list of all of the colours.
This would allow the selection of multiple colours and you can retrieve them with the contentarray function IIRC. |
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
|||
|
|||
|
I guess I'd have the list pipe separatd:
Red|#ff0000 Blue|#0000ff etc. Then I'd use some inline PHP to split each element into an array and access it that way. Not ideal though. |
|
#5
|
|||
|
|||
|
I thought I'd read on here that you could have multiple parents and that was how I planned set my colours, but I guess a definition can have multiple parents, an item of content can not.
|
|
#6
|
|||
|
|||
|
Nope, it's something I've got on my to-do list but not been implemented yet.
|
|
#7
|
|||
|
|||
|
When you say not ideal is that because of the hassle of setting it up or potential performance issues?
|
|
#8
|
|||
|
|||
|
Set up - it's a bit messier than it could be, but it'll work and it'd be faster than using definitions.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|