Posts: 57
Threads: 2
Joined: Feb 2015
Hello,
I am trying to achieve the following URL structure:
Code:
root/
│
│
├─ root/category-1/
│ │
│ │
│ └ child page of category-1
│ │
│ └ child pages of category-1 child page
│
│
├─ root/category-2/
│ │
│ │
│ └ child page of category-2
│ │
│ └ child pages of category-2 child page
│
│
├─ root/about/
│
└─ root/contact/
I know I can work with parent pages as categories but I don't want to show the categories page itself. Is that possible?
Thank you very much in advance.
Posts: 109
Threads: 7
Joined: Nov 2012
(2018-06-25, 22:06:40)smsHH Wrote: Hello,
I am trying to achieve the following URL structure:
Code:
root/
│
│
├─ root/category-1/
│ │
│ │
│ └ child page of category-1
│ │
│ └ child pages of category-1 child page
│
│
├─ root/category-2/
│ │
│ │
│ └ child page of category-2
│ │
│ └ child pages of category-2 child page
│
│
├─ root/about/
│
└─ root/contact/
I know I can work with parent pages as categories but I don't want to show the categories page itself. Is that possible?
Thank you very much in advance.
Use the plugin "i18n custom fields" and create a custom field called "link". This field must contain the value # at pages category-1, category-2, ...
Alex
Posts: 1,247
Threads: 82
Joined: Feb 2011
(2018-06-25, 22:06:40)smsHH Wrote: Hello,
I am trying to achieve the following URL structure:
Code:
root/
│
│
├─ root/category-1/
│ │
│ │
│ └ child page of category-1
│ │
│ └ child pages of category-1 child page
│
│
├─ root/category-2/
│ │
│ │
│ └ child page of category-2
│ │
│ └ child pages of category-2 child page
│
│
├─ root/about/
│
└─ root/contact/
I know I can work with parent pages as categories but I don't want to show the categories page itself. Is that possible?
Thank you very much in advance.
Yes. You can make the parent page private, while the sub-pages are visible, although it might still show in the url (depending on your permalink structure, I think)
Posts: 57
Threads: 2
Joined: Feb 2015
Thank you both, but I can't get this to work. If I set the parent page to private, the child pages will also not be shown. I have also tried to change the permalink structure, but with no success.
Alex, I have tried this but the link doesn't appear in the navigation menu. Can you provide an example how to use this?
Thank you again :-)
Posts: 538
Threads: 12
Joined: May 2013
2018-06-26, 03:50:18
(This post was last modified: 2018-06-26, 03:52:39 by Bigin.)
Hi ;-)
(2018-06-26, 03:09:27)smsHH Wrote: If I set the parent page to private, the child pages will also not be shown.
You mean page content? GetSimple 3.3.13 doesn't care if parent is private, it always only takes care of content from current page, so it will be shown for sure
Posts: 57
Threads: 2
Joined: Feb 2015
Hi Bigin,
thank you for your answer. I forgot to mention that I am using the I18N plug in because I need the hierarchical structure. If I uncheck the 'Add this page to the menu' checkbox or set the page to private it doesn't show its children page(s).
Posts: 1,247
Threads: 82
Joined: Feb 2011
2018-06-26, 08:27:46
(This post was last modified: 2018-06-26, 08:33:03 by datiswous.)
If you only want to ignore them in the menu, I think you can find that info here:
http://mvlcek.bplaced.net/get-simple/mul...navigation or someone else knows the exact info.
For example <?php get_i18n_navigation(return_page_slug(),1,99); ?> , I think would ignore all parent menu items.
Posts: 57
Threads: 2
Joined: Feb 2015
Thank you for your answer, but this doesn't work - the child pages will not be shown if the parent page is hidden.
Maybe I think too complicated, I just want to have two sections which can maybe achieved with approbiate .htaccess settings? For better understanding, I have done a new diagram of the structure (area-1 has a similar structure as area-2):
Code:
domain.com/ <- Here is the option to select between area-1 and area-2
¦
¦
domain.com/area-1/ +------+------+ domain.com/area-2/
¦ ¦ ¦
¦ ¦ ¦
. ¦ + domain.com/area-2/page-1/
. ¦ ¦ ¦
. ¦ ¦ ¦
¦ ¦ + domain.com/area-2/page-1/subpage/
¦ ¦
¦ ¦
¦ + domain.com/area-2/page-2/
¦ ¦
¦ ¦
¦ + domain.com/area-2/page-3/
¦ ¦
¦ ¦
¦ + ...
¦
¦
+ domain.com/about/
¦
+ domain.com/contact/
¦
+ domain.com/imprint/
¦
+ domain.com/privacy/
about, contact etc. is globally available. area-1 and area-2 don't have to be pages, they are just there to separate the domain into two different sections.
Thank you again!
Posts: 538
Threads: 12
Joined: May 2013
Why don't you make the parents visible and just exclude them from the menu so that no direct link to the parents is shown? If these should also not be accessible, you can simply redirect:
RewriteRule ^category-1/$ category-1/child-of-category-1/ [R=301,L]
Posts: 57
Threads: 2
Joined: Feb 2015
Thank you very much @ all!
I nearly found a solution (at least I hope so) with
Code:
get_i18n_navigation('area-1', 1, 99, I18N_SHOW_MENU);
as explained on mvlcek's
Multi-level Navigation page except for two points.
1. The active button gets no 'current' class
2. The path of a child -> child page is missing the first parent in its url:
It should be
domain.com/area-1/page-1/subpage/ but it's actually
domain.com/page-1/subpage/ because
subpage is a child of
page-1 while page-1 is a child of
area-1
Do you have an idea how I can solve this?
Thank you.
I believe in GetSimple
Posts: 538
Threads: 12
Joined: May 2013
GetSimple only supports a 2 level url structure (that would definitely be the first thing I would change as a developer).
But as far as I remember, I18N plugin allows multiple url structures, try to change in GS settings custom permalink structures to: %parents%/%slug%/
Posts: 57
Threads: 2
Joined: Feb 2015
OMG,
it works!
Thank you so much! You made my day :-)
I'll try to look into the class problem. But this helped me a lot