Jump to content

Advice on structure/build of following

Peter Knight

Recommended Posts

Hi guys

I have an upcoming build and I'm wondering how best to structure the data in the admin. What would you do?

The site focuses around the following which are all interlinked and cross referenced/tagged etc

Chocolate Bars, Confectioners and Chocolate sellers/shops  

Chocolate Bars 

A section containing a page on every cholcate bar where bars are products. Each bar would also have a type such as "Milk Chocolate" or "Dark Chocolate" and you could click on these types to bring up a list of the same types of bars matching that variety.

  • Mars
  • Aero Mint
  • Hazel-nutto 
  • Milky Chocco
  • etc etc



A list of every chocolate maker in the World.  Each confectioner would have a profile page and a list of bars they make. Bars link back to the Chocolate Bar pages while locations and countries links back to a list of Confectioners in the same country.

  • Cadburys
  • Hersheys
  • etc etc



Every shop that sells chocolate. Each bar they stock would link back to individual Chocolate Bar pages. 

  • Shop 1
  • Shop 2
  • Shop 3
  • etc

I think my uncertainty regarding best approach is because the volume of pages will be huge and I want to get the structure correct from the start. 

On the front-end I gather I'll be using selectors quite heavily and using tags a lot but right now I'm more interested in the back end structure.

I thinK Ryan's demo Skyscraper site will be worth a download as it looks kinda similar.

Link to comment
Share on other sites

Ah, this is one of my famous big piece of paper things - design it on the floor first of all, it will become a lot clearer!

I suggest in the middle of your paper you write Chocolate Bar - this will be central to everything, sort of. Each bar has a type, a manufacturer and a stockist. Though, the stockist will choose the bar and not the other way round.

On the chocolate bar side, this is just a case of multi categorization.

Any page can be linked to one or more categories and different sets of categories.

So, you can use multiple page fields to create:

Chocolate Types - milk, dark (different percentages), etc

Chocolate Origins - countries, basically

Additional flavours - orange, mint...

You could set these page fields like you would tags, so that you can add new variations on the fly. You can also set them to choose more than one from each category. There is no problem in searching that sort of thing.

You would also have a page field for a list of confectioners, but obviously, that would be single select for each bar.

Shops are really a separate deal. They basically stock bars - the rest of the info comes with the bar.

The slightly difficult bit is when you need to select which chocolate bars a shop stocks. Selecting one by one would be awful and you cannot guarantee they stock all from a particular manufacturer.

I suppose you can list all as check boxes - I wonder how many you could list before it explodes?

Once you do get all that together, the real trick is in the searching, to be honest. But since everything is cross linked, that might make your eyes cross, but wont be dreadful.

  • Like 3
Link to comment
Share on other sites

Building upon what you described in your original post and what Joss said...

Templates and Relationships
- bars (bars.php)
  - bar1 (bar.php)
  - bar2 (bar.php)
  - barN (bar.php)
- chocolate types (chocolate_types.php)
  - chocolate_type1 (chocolate_type.php)
  - chocolate_type2 (chocolate_type.php)
  - chocolate_typeN (chocolate_type.php)
- confectioners (confectioners.php)
  - confectioner1 (confectioner.php)
  - confectioner2 (confectioner.php)
  - confectionerN (confectioner.php)
- shops (shops.php)
  - shop1 (shop.php)
  - shop2 (shop.php)
  - shopN (shop.php)
- countries (countries.php)
  - country1 (country.php)
  - country2 (country.php)
  - countryN (country.php)
- bars (page field, multi-select asm or whatever is the most appropriate given amount of data)
- chocolate_type (page field, regular select or whatever makes the most sense; i'm assuming each bar has one chocolate type)
- confectioners field (page field, multi-select asm or whatever is the most appropriate given amount of data)
- shops field (page field, multi-select asm or whatever is the most appropriate given amount of data)
- country field (page field, regular select or whatever makes the most sense; i'm assuming each confectioner has one country)
Templates w/ Fields
- bar.php
  - title
  - (etc)
  - chocolate_type
- chocolate_type.php
  - title
  - (etc)
- confectioner.php
  - title
  - (etc)
  - bars
  - country
- shop.php
  - title
  - (etc)
  - bars
- country.php
  - title
  - (etc)
Example Code Per Template
- bars.php
  list bars: foreach($page->children as $bar)
- chocolate_types.php
  list chocolate types: foreach($page->children as $chocolate_type)
- confectioners.php
  list confectioners: foreach($page->children as $confectioner)
- shops.php
  list shops: foreach($page->children as $shop)
- countries.php
  list countries: foreach($page->children as $country)
- chocolate_type.php
  list bars that have the chocolate type: $bars = $pages->find("parent=/bars/, template=bar, chocolate_type={$page}"); foreach($bars as $bar)
- confectioner.php
  list bars: foreach($page->bars as $bar)
- shop.php
  list bars: foreach($page->bars as $bar)
- country.php
  list confectioners in the country: $confectioners = $pages->find("parent=/confectioners/, template=confectioner, country={$page}"); 
  • Like 2
Link to comment
Share on other sites

Well, the three  five top levels might be:






Er .. something else.

Basically, the rule would be "What questions is the visitor most likely to ask?

Then you can just have a hidden parent(s) for all the other bits and pieces - flavours, weights, tags, whatever.

One thing I suggest is you probably do the menu manually, rather than try and work through everything!

So, Bars would only be a single menu item, but the bars page would have all the subdivisions and so on with some lovely intro stuff. Locations/countries should wax lyrical about the areas of the world.....

hmmm... bit of a copywriters dream this, to be honest.... :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...