localgovdrupal / localgov_subsites

Replaces LocalGov Campaigns with a new name and extended functionality to support subsites within LocalGov Drupal installations.
GNU General Public License v2.0
4 stars 2 forks source link

Added PreviewLinkAutopopulate plugin to auto-populate preview links #146

Closed stephen-cox closed 2 weeks ago

stephen-cox commented 2 months ago

Part of localgovdrupal/localgov#600

ekes commented 2 months ago

Is there something else that needs to be done other than checking out the branch. I've got it, and done a site install, and used demo, but I don't see the button, only one to copy the preview link.

Also is it intentionally only getting the next level of child pages, or should it be getting all child pages (using the Nested Storage)?

stephen-cox commented 2 months ago

Also is it intentionally only getting the next level of child pages, or should it be getting all child pages (using the Nested Storage)?

I missed that subsite pages can also be parents along with overviews, I'll have to update to logic to handle this.

finnlewis commented 2 months ago

@stephen-cox working on this today

stephen-cox commented 3 weeks ago

@ekes I have updated this PR to use Entity Hierarchy to load the nodes in a subsite; which is frankly a pain to work with. Loading all nodes is not straightforward so I've added a test.

Would be nice to get this reviewed before Next Tuesday, if possible, as it's been hanging around for a while now.

ekes commented 2 weeks ago

Loading all nodes is not straightforward so I've added a test.

It's just get root, get all ancestors of root, and load them? Seems straightforward to me. Pain I found is the way that NestedSet class has be abstracted so you don't get code completion (or I don't anyway).