Jump to content

echo menutext|title for parent pages


kaz
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...