Jump to content

GKM490

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by GKM490

  1. Hi there, I am currently setting up a role for a user that will be in charge of editing a list of topics for our pages. I don't want them to be able to edit *anything* else about the page, including the title. Right now I'm accomplishing this by going through the fields on every page template that they have access to, and changing the access so that the "view" permission is set for all, but "edit" is only checked for admin roles and unchecked for the topic editor, and then the "topic" field is the only one with edit access checked for this topic editor role. This is very tedious, and doesn't account for future changes to the templates if we add or remove fields. I'll have to be sure to go into the permissions for new fields and make sure they all follow this format. Is there some sort of "Role Field Edit Whitelist" where all fields are disabled for editing for a role, except for ones that appear in the whitelist? Thanks!
  2. Ohh I had been treating ready.php as init.php then. I only have hooks in ready.php and didn't realize that $page existed in that file outside the context of a hook. So that's what the comments at the top were referring to, haha. Thanks for the clarification! That helps me understand the distinction. 🙂
  3. This worked perfectly! I would never have guessed to put it in init.php. The commented line at the top: When this file is called, the current $page has not yet been determined. Made me think that I wouldn't be able to use $page = $event->arguments(0); to grab the necessary data about the page to save in the search index. Thank you so much for the response. Much appreciated!
  4. Bump, still haven't been able to figure out what event (if any) is triggered upon saving an inline CKEditor field named "content" using $page->edit('content') on the front end. Any help would be greatly appreciated. 🙂
  5. Hi there, I am trying to integrate Algolia into our website, and I'm wanting to hook into the saving of an inline CKEditor Content field on a page, so that when you double click, edit the content, and hit save, it updates the Search Index. Currently, I have this hook in ready.php: $this->addHookAfter('Pages::savedPageOrField', function(HookEvent $event) { $page = $event->arguments(0); wire('log')->save('debug', 'Saving Field'); }); Just to try and confirm that the event is executing, but when I save the content inline on a page, nothing gets added to my log. I have also tried with the Pages::savedField event and it also doesn't work. Is there a different hook I should be using? Thanks!
  6. Seems like installing the SessionHandlerDB module has fixed the problem for me, so that sessions are saved in the DB rather than the file system. Now it seems like the only time I get logged out is when I close my browser.
×
×
  • Create New...