Wondering if there's any good way to do this, but here's hoping. Found some really old threads that might be relevant, but nothing since like 2014.
In the current version of GC, is there any way to have an n_n relationship where one side is a tree structure, and have that fact visible in the Edit box?
Here's the relevant table structure:
Pages
PageID - Int, AI, primary index
PageName, etc....
Tags
TagID - Int, AI, primary index
TagName - varchar
ParentID - Int
Foreign key constraint setting Tags.ParentID to refer to Tags.TagID.
PageTag
PageID - Int
TagID - Int
Foreign key constraint setting PageTag.TagID to refer to Tags.TagID. Foreign key constraint setting PageTag.PageID to refer to Pages.PageID
The CRUD is set to display Pages.
$crud->set_table('Pages');
$crud->set_relation_n_n('Tags', 'PageTag', 'Tags', 'PageID, 'TagID, 'TagName');
The idea is that I can tag pages with multiple tags, but the tags themselves have a hierarchical relationship.
Like:
Tag 1
Tag 1.1
Tag 1.2
Tag 1.3
Tag 2
Tag 3
Tag 3.1
Any of the tags, 1, 1.1, 1.2, 1.3, 2, 3, 3.1 are legitimate things to tag a page with.
Everything works fine, except that in the Edit view, the hierarchical relationship isn't visible. I'd like it to show the user which tags are subcategories of what.
Is there any easy way to do this?
Thanks.