Jump to content

Not sure how to represent suborganizations for my use case


shadowkyogre
 Share

Recommended Posts

[EDIT]: After sitting down and planning out my site according to the ragged hierarchy information, I settled on the following schematics.

  • /$world/$template/$content_of_template_type/... for my pretty URLs
  • /roster/$character for my characters
  • a generic Repeater field with depth on most content types for custom positions for child pages to connect to instead of it directly
  • a few Repeater fields on each content that have (PageReference[1], other fields) to establish associations
  • A few FieldsetGroups to help me manage the fields that I needed to copy across a bunch of content types.

Kept the original post below for context and tagged the OP for searchability.

---

Hi everyone! I'm working on a personalized worldbuilding wiki to host my art and story stuff.

Right now my site architecture looks like...

  • /$world/cosmology/$cosmology
  • /$world/locations/$location
  • /$world/factions/$faction
  • /$world/history/$history
  • /$world/species/$species
  • /roster/$character

So far the layout works, but there's one problem. I need to make sub-sections for an organization. Organizations can appear under cosmology, locations, and factions. Sounds straightforward until... I run into the problem of figuring out how to represent subfactions.

Key factors in this are...

  • Characters should be able to be part of multiple organizations
  • Characters should have an explicit role assigned to their membership.
  • Character pages should be able to query the organization pages to display their ranks across organizations.
  • Editing an organization's hierarchical layout should be visible while editing the root organization page.

From what I've read of the ProcessWire documentation, the best use case for each way of representing the organization's subsections are...

  • Child Pages:: Works best for menu presentation and dedicated editing.
  • PageTables:: Works if you want control over where to place the PageTable fields, but requires opening a modal for the pages you want to edit. It's also kind of like normal pages.
  • Repeaters:: Works great for inline editing and easy control over hierarchy, but the page urls become obscure.
  • Sections in the body field:: Works for copypasting from my note files. But it doesn't expose relationships for easy querying.

It looks like my best case for this is child pages since it allows displaying suborganization in the URL easily. But also I lose out on quickly reordering and editing the child pages. Any advice for people running into similar use cases?

Link to comment
Share on other sites

I would consider how other systems work out the mapping of ragged hierarchies - where you store a hierarchy level in addition to the ancestors and children relationships. Having a two dimensional structures like this enables you to manage granularity level control as well as lineage control. It becomes trivial to isolate branch grouping based on a limit of the lineage and level - say less than three. Alternatively, you can also build queries that select peers across a given landscape. For example, if local heroes of a klan that is a subfaction of a race on a given world, you can list them alongside heroes that are also part of major clans without internal divisions, or even immortal heroes without lineage or clan that live on a mountaintop on a continent. Each 'level' number represents a granularity level, not necessarily a power, quality or quantity level.

The nice thing about this method is that it allows you to 'skip' levels while still retaining lineage integrity if you so choose.

Here's an example of building such a data structure for an unrelated BI tool, but I think you will understand the design pattern. Perhaps this is what you are looking for:

https://www.dundas.com/support/learning/documentation/analyze-data/create-a-ragged-hierarchy

  • Like 1
Link to comment
Share on other sites

Hi Gorny!

I wrote some of my data hierarchy in the format shown in the link as part of a brainstorming exercise. After doing so, I could see why I'd need to arrange it in a ragged hierarchy. I do have cases where some characters play a big role in the world without that role being tied to participation in an organization.

From a ProcessWire standpoint, I could see the information from the article and your post translating into the following::

  • Using the normal parent/child relationship in ProcessWire for pretty urls only (which'd make doing a site map really easy).
  • Current site has granularity levels of the following. World > (Location | Era | Cosmology) > Organization > Role > Species > Character . Each of these is probably going to be a template, though that's a lot of copypasting same fields from basic-page. But it'd also make querying specific data types easier. I'm still not entirely sure what to do with the basic-page template here since I still use that for many basic pages that just have information, but no need for granular relationship participation.
  • Example use cases I could think of with my own data include...
    • Some organizations have Organization > Role > Species and some have Organization > Role > _ > Character
    • Characters can be biologically classified by their Species > Character relationship. I'm not sure how wise it is to use a repeater with a single page reference and a text field to store additional variation information. Sometimes I just want to make bird characters without a wiki entry for each type of bird instead of grouping it into a broader biological category. Like having some ravens and peacocks, but filing raven and peacock characters under a generic talking animals page.
    • Some characters are notable across the world for a reason. So they may have a World > _ > _ > Role > _ > Character.
    • There are some Locations that aren't bound to a world. So they might not have a parent.
    • It might be useful in some cases to flip Role and Organization around. Like if a Location has a different relationship with an Organization, it might be useful to have a Location > Role > Organization role that reads "Enemy" and another that reads "Ally" for those role nodes.
  • Modeling multiple parents for each leaf by the following...
    • A Page Reference field for the worldbuilding data type that's just "parents", where all worldbuilding page template types are valid parents. Sloppy visually, but, it works?
    • A Page Reference field for each type of worldbuilding page template that can be a valid ragged hierarchy parent for a page. Might be a lot of field overhead though, but that's probably better for form readability.
  • After modeling the multiple parentage, if I understand how to model this in PW with the given available tools, a few other things I could do with this are...
    • A character page can query what bloodline they have by checking the Species > Character, as mentioned before.
    • A character can list specific roles they have for organizations by checking for Organization > Role > Character.
    • A character can list organizations they participate in, but don't have a chain of command role by checking their direct Organization parent.
    • Character specific roles could simply have no parent or World parents according to the page reference fields, but in the page tree could be stored directly under the character.
    • Organizations can list all members that don't have a role by checking for no Organization > Role > Character relationships, but there being an Organization > _ > Character relationship.
    • Chain of commands in organizations can be handled with nested Role relationships with the rootmost Roles being direct children of the Organization.

If there's anything I missed from my understanding that I'd need to consider, please let me know.

Link to comment
Share on other sites

The only thing I might suggest is that the Location Role and Organization Role seems like two different classifications - The tricky part that I see in general is that some of the items you talk about would be at the hierarchical level - say, at the vertical level of granularity - while other items are on at a description attribute levels - the horizontal level of classification.

Ultimately you will need to make some decisions with regard to what is considered an attribute and what is considered a degree of precision or size. I think the part that might mess with your head a bit is that there are likely going to be very common attributes of a variety of hierarchies. The advantage I can see from a PW perspective is that you could generate queries that pull selector values regardless of where they are in the hierarchy - but in terms of navigation structure I am not really sure how you would want to go about it without using URLSegments or something.

I have not tried to model out something that complicated in terms of URL structure - hopefully someone with more experience in tweaking segments can offer input...

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.
  • Similar Content

    • By MarkE
      I have a selector:
      $pageArray = $pages->find("template=basic-page, length.magnitude>0, include=all"); I would like an array of each of the 'length' fields. However, the field is an object and $pageArray->each('length') returns the formatted values; I want the unformatted objects.
      I thought perhaps I could use a callable like:
      $pageArray = $pages->find("template=basic-page, length.magnitude>0, include=all"); $lengths = $pageArray->each(function($p) { $length = $p->getUnformatted('length'); return $length; }); but it seems that only strings can be returned and those are concatenated.
      So it looks like I have to use a foreach() loop - which works, but I was expecting some neater shorthand. Any thoughts?
    • By Robin S
      Repeater Easy Sort
      Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number of items.
      The module also enhances Repeater Matrix by allowing a colour to be set for each matrix type. This colour is used in the item headers and in the "add new" links, to help visually distinguish different matrix types in the inputfield.
      Screencasts
      A Repeater field

      A Repeater Matrix field with custom header colours

      Easy-sort mode
      Each Repeater/Matrix item gets an double-arrow icon in the item header. Click this icon to enter easy-sort mode.
      While in easy-sort mode:
      The items will reduce in width so that more items can be shown on the screen at once. The minimum width is configurable in the field settings. Any items that were in an open state are collapsed, but when you exit easy-sort mode the previously open items will be reopened. You can drag an item left/right/up/down to sort it within the items. The item that you clicked the icon for is shown with a black background. This makes it easier to find the item you want to move in easy-sort mode. You can click an item header to open the item. An "Exit easy-sort mode" button appears at the bottom of the inputfield. Configuration
      In the field settings for Repeater and Repeater Matrix fields you can define a minimum width in pixels for items in easy-sort mode. While in easy-sort mode the items will be sized to neatly fill the available width on any screen size but will never be narrower than the width you set here.
      In the field settings for Repeater Matrix you can define a custom header colour for each matrix type using an HTML "color" type input. The default colour for this type of input is black, so when black is selected in the input it means that no custom colour will be applied to the header.
      Exclusions
      The easy-sort mode is only possible on Repeater/Matrix fields that do not use the "item depth" option.
       
      https://github.com/Toutouwai/RepeaterEasySort
      https://processwire.com/modules/repeater-easy-sort/
    • By Webrocker
      Hi,
      I updated to the currently latest master (3.0.184) and now a lister (listerPro 1.1.3) preset shows the info cited in the title.
      According to this closed issue this is supposed to work <del>in 3.0.184</del>
      https://github.com/processwire/processwire-issues/issues/1428

      or is this a lister(pro) issue?

    • By sebr
      Hi
      I'm using Processwire 3.0.180.
      When I edit a page in admin, Tracy Debugger count between 50 and 100 pages loaded, depending on the templates. All pages open in less than a second.
      But when I edited pages from a certain template, this pages opened in more than 40 seconds and Tracy Debugger count more than 14000 pages loaded.
      When I look in the pages loaded list, I find a very large amount of lines that look like this:
      1247 /sc_admin/repeaters/for-field-182/for-page-1246/ Page 1248 /sc_admin/repeaters/for-field-158/for-page-1246/ Page 1249 /sc_admin/repeaters/for-field-159/for-page-1246/ Page 1250 /sc_admin/repeaters/for-field-169/for-page-1246/ Page 1251 /sc_admin/repeaters/for-field-170/for-page-1246/ Page 1252 /sc_admin/repeaters/for-field-180/for-page-1246/ Page 1254 /sc_admin/repeaters/for-field-137/for-page-1253/ Page 1256 /sc_admin/repeaters/for-field-182/for-page-1255/ Page 1258 /sc_admin/repeaters/for-field-170/for-page-1195/ Page 1261 /sc_admin/repeaters/for-field-182/for-page-1132/ Page 1262 /sc_admin/repeaters/for-field-159/for-page-1132/ Page 1263 /sc_admin/repeaters/for-field-169/for-page-1132/ Page 1264 /sc_admin/repeaters/for-field-170/for-page-1132/ Page 1265 /sc_admin/repeaters/for-field-180/for-page-1132/ Page Or other like :
      10222 /sc_admin/repeaters/for-field-138/for-page-5710/1623420295-8678-1/ RepeaterMatrixPage 10232 /sc_admin/repeaters/for-field-138/for-page-5710/1623420316-7346-1/ RepeaterMatrixPage 10242 /sc_admin/repeaters/for-field-138/for-page-5708/1623482402-7605-1/ RepeaterMatrixPage 10256 /sc_admin/repeaters/for-field-138/for-page-10254/1624257169-0968-1/ RepeaterMatrixPage 10266 /sc_admin/repeaters/for-field-138/for-page-10254/1624257191-2937-1/ RepeaterMatrixPage 10278 /sc_admin/repeaters/for-field-138/for-page-10254/1624257284-3093-1/ RepeaterMatrixPage 10289 /sc_admin/repeaters/for-field-138/for-page-10254/1624258816-4716-1/ RepeaterMatrixPage 10302 /sc_admin/repeaters/for-field-138/for-page-10254/1624259001-0062-1/ RepeaterMatrixPage 10312 /sc_admin/repeaters/for-field-138/for-page-10254/1624259056-5808-1/ RepeaterMatrixPage 10326 /sc_admin/repeaters/for-field-138/for-page-10254/1624259204-4337-1/ RepeaterMatrixPage 10336 /sc_admin/repeaters/for-field-138/for-page-10254/1624259240-545-1/ RepeaterMatrixPage 10347 /sc_admin/repeaters/for-field-138/for-page-10254/1624259280-7777-1/ RepeaterMatrixPage 10357 /sc_admin/repeaters/for-field-138/for-page-10254/1624259299-317-1/ RepeaterMatrixPage 10369 /sc_admin/repeaters/for-field-138/for-page-6006/1624259684-8705-1/ RepeaterMatrixPage 10381 /sc_admin/repeaters/for-field-138/for-page-10379/1624259765-4187-1/ RepeaterMatrixPage More than 10000...
      This template doesn't contain repeaterMatrix.
      How can I understand what's happened ?
      Thanks for your help
    • By Guy Incognito
      We have a client's Processwire site where the Pageimage::size() method has stopped working. It's creating small white PNGs in the assets folder instead of the resized image as usual.
      Their hosting was recently upgraded and switched to PHP 7.4 and I'm wondering if a they've removed a PHP package or changed a server config to cause this.
      Does anyone know if the image resizing functionality requires specific PHP modules I need to check for?
      I've checked the folder permissions on the server - this all looks fine.
      TIA,
      J
×
×
  • Create New...