Jump to content

Jimmie Bragdon

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Jimmie Bragdon

  1. Thanks, @teppo, I looked into that. I went with the following: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { $page = $event->arguments('page'); $siteName = $page->rootParent->title; $parentSelector = 'parent=/tags/'.$siteName.'/'; if($event->object->hasField == 'Tags') { $event->return = $event->pages->find($parentSelector); } }); This selects the right tags now in the ASMselect input field. I did have to abandon letting new Pages be created from the template, as it was not placing them in the correct place in the tree (It was dropping them in /tags/ instead of /tags/sitename/) and had to remove the required parent (previously set to /tags/) as it wasn't detecting the proper parent on the tags, so wouldn't save them to the page in question. But at the cost of manually creating the tag pages, the rest of the solution seems to work!
  2. Wondering if anyone can help me get past a sticking point. I'm setting up a Processwire instance in a multiple site setup (using Soma's multisite) to run several related websites. I am getting stuck on the tagging system that I am using (adapted from a standalone PW site I'm running). I have the tags themselves set up as Pages, and the Tags field on the related pages is and ASMselect field that populates based on the pages underneath /tags/ in the tree. This system works fine on the standalone site. Where I am running into issues, is with trying to use them with the multisite setup. Specifically, choosing the proper subset of pages for tags on the ASMselect input tab. I want to choose only the tag pages for the site in question. My tree is laid out like this: Multisite / | site1.com | subsections | site2.com | subsections | Tags | site1.com | tagA | tagB | site2.com | tagC So far, the best I've been able to do is to use 'parent.has_parent=/tags/' in the Custom Find or Selector String portion of the Selectable Pages section of the input. This gives me the options of choosing tagA, tagB, or tagC on a page under site1.com. What I'd like to find is a selector that allows me to only see tagA, tagB as options from a page under site1.com and only tagC on a page under site2.com. Elsewhere in my php templates, I'm using $page->rootParent->title to set the proper scope and URLs for things, but I have not found a way to get that to work in this field input setup. I am trying to avoid creating specific fields and templates for each site, as unified templates were part of the purpose of going with a multisite install. Thanks in advance for any ideas.
×
×
  • Create New...