Recently Browsing 0 members
No registered users viewing this page.
I am running a page template that contains a filter form that allows users to display results based on number of comments.
Here is what I am thinking about doing:
-add new field called total_comments
-somehow populate this field every time a new comment is added or removed by admin with count($page->comments)
-use form filter to display results that the selector form has found.
Example: $selector = “total_comments>=$q”;
My question to everyone: Is this a good approach? If so how do I get another field to update based on the comment module adding or removing a comment?
I am using the formSubmitSuccess form builder hook to send a copy of the form submission to a third party.
However I couldn't figure out how to get the submissions form type at this point, the reason being is that I only want to send the data onto the third party for certain form types.
I don't have the submission details being passed into the hook, wasn't sure how to achieve this so at the moment I have it doing a DB query to pull the latest submission details for that form type so I'm rather stumped about how I can go about achieving this.
Hope thats makes sense.
I'm trying to limit a specific user can only add pages as a child (under) a page created by themselves.
The discussion in this thread gets close, it's a working solution on how to only allow editing on pages you created yourself. I'm using this and it works well. But I'm not sure how to modify this for my purposes.
I'm suspecting I need to do to something like
$this->addHookBefore("Page::added", $this, 'added');
then in "added" check if parent is created by the current user. But I'm a bit lost on how exactly to do this.
thank you! /J