Jump to content

Site structure advice, children or page links?


Mackski
 Share

Recommended Posts

Probably a pretty common scenario, but thinking long term and scalability what are the pros and cons of the following data structures to achieve the same thing?
The only draw back of option 1 is that you cannot see the relationship of data at a glance. I would need to create some custom pages to show all related data to a person.

Option 1 - Page links
This is taking a more SQL approach, where a page represents a database table with link fields to other pages.

People
Activities
Events
  - Person Link
  - Activity Link

Option 2 - Nested Structure (preferred?)
This option is fine, however, for each person the child tree needs to be created upon first login. Subject to changes this could get messy for existing people entries.

People
   - Activities
         - Events
  

Link to comment
Share on other sites

To me, Option 1 seems more logical, and more organized. Page links would be more useful and intuitive in the future when you're trying to select related data, rather than finding them through a node's children.

Consider:

$pages->find("template=event, personreference=$person");

against:

$pages->find("template=event, has_parent=$person");

 

I think the first one would be easier to understand, and would execute faster.

  • Like 1
Link to comment
Share on other sites

8 minutes ago, Alxndre' said:

To me, Option 1 seems more logical, and more organized. Page links would be more useful and intuitive in the future when you're trying to select related data, rather than finding them through a node's children.

This was my initial thought, considering other pages might need access. I guess the only draw back, is if you have a lots of people, the size of the dropdown or radios etc, might get a bit crazy, not sure what the best solution for display would be in this case.

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
 Share

  • Recently Browsing   0 members

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