Page 1 of 1

Allow Static pages to have children.

Posted: Tue Jan 30, 2018 12:31 pm
by BlakesHeaven
As per the title.

I don't think this is currently possible, but I'd certainly find it useful to link sub-pages to a static page. with option to display on menu of not for each page.

Re: Allow Static pages to have children.

Posted: Tue Jan 30, 2018 1:48 pm
by Edi
If you want to build a website with subpages you can set "order content by" to "position" (at advanced settings).

Static content is for additional pages, if you have a blog, or content, that can be used in a sidebar or the footer for example, if a theme makes use of this feature.

If you want a website and a blog just use two installations and link them.

Re: Allow Static pages to have children.

Posted: Tue Jan 30, 2018 6:29 pm
by diego
Hi, I would like to know what kind of website are you working? I mean the structure you need. thanks

Re: Allow Static pages to have children.

Posted: Fri Feb 02, 2018 2:39 pm
by BlakesHeaven
Thanks for asking. The web site is to post up a program of events for a concert club with six events per quarter.

Let me just say that this came from me initially playing around to evaluate Bludit and when I tried the "Lingoberry" theme (which has no left menu, but a horizontal menu). At the time I may not have turned something on, but I was struggling to gain access to content that was not static.

Anyway, I realised the static Items appeared at the top horizontal menu and thought that might be a way of gaining access to a page that shows all and also provides links to the separate event pages as I do now. Only I realised I couldn't say the Lead-in page was a parent of the separate children pages, which is preferable from an Admin point of view.

2018 -Q1 (parent 1)
  • Event 1- (child)
  • Event 2 - (child)
2018- Q2 (parent 2)
  • Event 1- (child)
  • Event 2 - (child)

Anyway, I'm now using a slight variant of the default theme (that I'm tweaking myself) now and showing the Content in the left menu making use of the parent/child relationships. Yes - indeed, I am using the order by 'position'.

Potentially and optionally, if the content is both static and a parent, the children could appear as submenu items

Anyway, I'll leave that with you...
... and also say that I'm really happy with Bludit having chosen it over a number of other solutions.

Re: Allow Static pages to have children.

Posted: Sat Feb 03, 2018 10:54 am
by diego
I think your site is correct like you mention.
- Order by position
- Pages with Subpages

The problem here is the theme and maybe the plugins for the sidebar. I'm working on the user experience with Edi (he has some good ideas), also I always ask what kind of site do you want to do and try to find the easy and best way to do it.

Regards

Re: Allow Static pages to have children.

Posted: Sun Feb 04, 2018 12:12 am
by Edi
I added an additional plugin to show a navigation in the sidebar of all published pages.

The plugin allows to choose, if subpages should be shown or not.

You can download it from:

https://github.com/bludit-plugins/navigation

Re: Allow Static pages to have children.

Posted: Tue Feb 06, 2018 3:12 pm
by BlakesHeaven
Fantastic - thanks Edi!
I've downloaded it and will give it ago. :D
Cheers,
David

Re: Allow Static pages to have children.

Posted: Thu Feb 15, 2018 12:57 pm
by Torsten_Kelsch
This is the plugin I’ve really been waiting for (but couldn’t program by myself because of my weak programming skills). Very useful. Thanks, Edi!

Re: Allow Static pages to have children.

Posted: Thu Feb 15, 2018 2:45 pm
by Torsten_Kelsch
I wrote a little improvement to Edi’s navigation plugin: The code recognizes, which page the user is currently on. Those currently visited pages can be highlighted in the menu via CSS.

Code: Select all

#$html .= '<li class="menu"><a href="'.$Parent->permalink().'">'.$Parent->title().'</a></li>';
$html .= '<li'.( ($Parent->key()==$Url->slug())?' class="active"':'').'><a href="'.$Parent->permalink().'">'.$Parent->title().'</a></li>';
The line no. 57, which I commented out, is the original, and the line below is my modification. I deleted the class, which was given each and every list item. This is not needed, because the unordered list has already a class, so the styling for the list items can be done in the CSS file like this:

Code: Select all

ul.menu li {
  …
}
Instead, I gave a class only to the list item for the currently visited page. And that can be styled via CSS, for example like the following:

Code: Select all

.active {
  font-size: bold;
}