Jump to content

Recommended Posts

Posted

I couldn't find anything suitable in the API.
I'm looking for a way to number breadcrumbs with numbered itemprop='position' content='x'. Home = 1, and so on.
Is there a way to number the order of visible pages of the pages of the breadcrumbs (content='number')?

<meta itemprop='position' content='2' />

 

Posted

Hi,

well actually, as when displaying breadcrums i use

<?php foreach($page->parents() as $parent): ?>

i think that while looping through the parents array, something like

<?php
foreach($page->parents() as $pid => $parent) {    
    $position = $pid + 1; //except if you want your position starting by 0
}
?>

would do the job $pid being different from $parent->id of course

hope it may help 🙂

have a nice day

  • Like 1

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
  • Recently Browsing   0 members

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