kaz Posted May 13, 2021 Share Posted May 13, 2021 I coded breadcrumbs (I know, only two levels) with a simple code. Because titles are usually too long for breadcrumbs I added menutext to the first level (Home): <?php if ($page->id == 1 ): ?> <ul class="uk-breadcrumb"> <li><span><?php echo $page('menutext|title'); ?></span></li> </ul> <?php else: ?> <ul class="uk-breadcrumb"> <li><a href="<?php echo $page->parent->url; ?>" title="<?php echo $page->parent->title; ?>"><?php echo $page->parent->title; ?></a></li> <?php if ($page->title): ?> <li><span><?php echo $page->title; ?></span></li> <?php endif; ?> </ul> <?php endif; ?> In the first level it works fine, I see 'Home' instead of 'Welcome on our …' The echo does not work for the parent layers: <?php echo $page->parent('menutext|title'); ?> This is surely because two -> occur? How to insert menutext correctly for parent pages. Link to comment Share on other sites More sharing options...
elabx Posted May 13, 2021 Share Posted May 13, 2021 Try: $page->parent->get('menutext|title'); 1 Link to comment Share on other sites More sharing options...
kaz Posted May 13, 2021 Author Share Posted May 13, 2021 14 minutes ago, elabx said: Try: $page->parent->get('menutext|title'); -> get, learned again 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now