Hierarchical data structure
-
Hello.
I’m new to pods and would like to imitate the following law site, in simpler:
legifrance: block with 1 article,
legifrance : block with 2 articles.
At this stage, ignore the sidebar (versioning and rolling table of content). You will note a path (“chemin”, in French) at the top, and hyperlinks to children pages below the article(s). Moreover, if you click on “Code des assurances” (after “chemin”), the legal text name (in this case “code of insurance”), you get a table of contents of the text: table of contents. At the bottom, you have 2 links: “<< Bloc précédent – Bloc suivant >>”, meaning “previous block (of articles)” and “next block”. So blocks may have their own articles, as well as children blocks. I created advanced custom content types for articles, for blocks and for legal texts, with bi-directional relationship fields between a legal text and its blocks, between a block and its articles, between a block and the next block. I will also need a bidirectional relationship between a block and its children blocks. My problem is how to manage the order? For instance, for a block, I want to list its children IN THE RIGHT ORDER (i.e. the order they have in the legal text itself). Unlike legifrance, I don’t intend to enter full legal texts inside my database, but only extracts, plus the titles of big parts, and I don’t want to renumber manually the blocks or articles each time I insert a new one between 2 ones which are already in the database. Ideally, I would like the articles and blocks to get ordered automatically according to their official legal number. For instance, L300-1 is before L364-2 but after L127-2-1. Would you have any advice for the data structure?Thank you in advance.
- The topic ‘Hierarchical data structure’ is closed to new replies.