Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive hide form on pages #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Recursive hide form on pages #24

wants to merge 2 commits into from

Conversation

mandrew
Copy link
Owner

@mandrew mandrew commented Mar 24, 2016

added checkbox and recursive function to hide form if checkbox returns true. Also added page extension to add checkbox in CMS

}

// public static function HideForm($this->) {
// return $this->owner->HideFeedbackForm;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the comments.

@camfindlay
Copy link
Collaborator

Unit tests seem to be failing.

while($page->exists()) {
if($page->HideFeedbackForm) return false;

$page = $page->Parent();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the logic here? What happens if I have a parent page with the feedback form turned off, but I want a child page to still show?

@mandrew
Copy link
Owner Author

mandrew commented Mar 28, 2016

@camfindlay @assertchris build should be fixed but the outstanding issue is that it won't recursively check for 3rd level pages (or more?). I think a status needs to be set (rather then setting $previous = $parent;) and then if this status is 'hide' then return false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants