Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Categories
#1
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.
Reply
#2
(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
Reply
#3
(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)
Reply
#4
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 :-)
Reply
#5
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
Reply
#6
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).
Reply
#7
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.
Reply
#8
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!
Reply
#9
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]
Reply
#10
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 Huh

Do you have an idea how I can solve this?

Thank you.

I believe in GetSimple Wink
Reply
#11
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%/
Reply
#12
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 Exclamation
Reply




Users browsing this thread: 1 Guest(s)