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

setting a parent not possible #975

Open
Joduai opened this issue Feb 27, 2019 · 4 comments

Comments

@Joduai
Copy link

commented Feb 27, 2019

Howdy
Just wanted to pop up an issue with setting a parent.
I've found an old issue treating about this function here:
#604

Basically why it is not possible to set a parent to a default page type when parent page is static?
What's the sense of having a possibility to set a parent for a default page type only for the same default page type? There's not even a way to set a static parent for a static page, making the Navigation plugin completely unusable.
Only combination between default page types seem to work, no matter what's the default order is set up.

In current state the option to set a parent is completely broken, and comparing to the issue from last year it's a regress.

Could you point me where should I search in bludit's core to get rid of any conditionals and unblock this function? Parent page typed manually in parent's field is being cut during save.

edit:
Okay, seems that only default pages (published) can be set as parents, as buildParentPages() takes only getPublishedDB() results.
I got rid of this by merging all pages DB arrays , but after saving couple test pages, everything started to look more complex than I thought.

@BlakesHeaven

This comment has been minimized.

Copy link

commented Mar 6, 2019

My issue is that default pages with a status of published can not be set as a Parent if the scheduled date is set in the future.
I guess my issue also lies in getPublishedDB(), but I only dabble a bit with php, so can't see how to hack it and fix #700 .
Good luck.

@Joduai

This comment has been minimized.

Copy link
Author

commented Mar 6, 2019

@BlakesHeaven
I've read your issue some time ago, but I haven't understood what exactly you would like to achieve.
When it goes to setting a parent it needs a relatively small change in core file, to have a way of choosing other types of pages, and let them become a parent.

you can try it by modifying blkernel/functions.php file
around line: ~161 should be a buildParentPages() function
There is supposed to be only $pagesKey = $pages->getPublishedDB();
Just check it, and merge all page databases instead of only published pages like below example I used

$list = array();
$pagesKey_1 = $pages->getPublishedDB();
$pagesKey_2 = $pages->getStaticDB();
$pagesKey_3 = $pages->getStickyDB();
$pagesKey_4 = $pages->getScheduledDB();
$pagesKey = array_merge($pagesKey_1,$pagesKey_2,$pagesKey_3,$pagesKey_4);

Then you should be able to choose a parent for any type of page you create or edit.
This is only a "fix" for this one feature. I don't know if scheduled page with a set up parent page will work without modifying other core function in your case.

@BlakesHeaven

This comment has been minimized.

Copy link

commented Mar 7, 2019

@Joduai , thanks for all that detail; I'll have a look, but I would prefer to stay true to the core code.

What I would like to achieve: prepare a group of pages - 1 parent and several children, scheduled for a future date and without touching them again have them all appear on the website at the same time.

Currently, with this issue, Parent/Child groups cannot be scheduled ahead of time in the format they need to appear. Always the pages need to be reconfigured after the scheduled date, which makes the concept of scheduling pages pointless for parent/child groups.

Background - I put together uwcc.uk, which is a small concert club website advertising a programme of planned events. The parent page holds a summary of all events, and the children hold the detail.
All these pages for a programme are a group and should appear on the website at the same time. My auto archive menu plugin uses the published date to auto move the menu items as time passes.

@Joduai

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

@BlakesHeaven this is just a dirty fix for setting a parent of other type, than default published page.
I don't have any other choice than to make changes in core code after every update. As long as I'm going to use bludit of course ;)

I've just checked couple mins ago with a scheduled page with parent set up as a static page, and everything works fine (I'd be surprised if it wasn't)
Rest is a matter of proper frontend templating.

ps. don't forget that children will be shown in admin panel under the apropriate parent page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.