Jump to content

Text Tags Ajax Question


Tom.
 Share

Recommended Posts

Hello,

I haven't actually used ProcessWire for a while as I've been using Webflow to build websites recently. I am actually looking at doing my own version of Udesly that interfaces with Webflow, so people can export from Webflow to make ProcessWire themes... Anyway. 

I was wondering why the example of Text Tags uses:

$wire->addHook("/find-field_options/", function($e) { 
  $q = $e->input->get("q", "text,selectorValue");
  if(strlen($q) < 3) return []; 
  return array_values($e->pages->findRaw("parent=/tags/, title%=$q, field=title"));
});

I thought the correct way of using findRaw is:

$e->pages->findRaw("parent=/tags/, title%=$q", "title")

 

Link to comment
Share on other sites

@Tom - I think the field=title within the quotes selector, vs having the list of fields in a separate quoted group is optional either way. The "array_values" is needed because the text tags needs the array to be indexed numerically starting at zero, rather than the page IDs which findRaw() returns.

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.

×
×
  • Create New...