MyBB Community Forums

Full Version: How to get Breadcrumb Position Number ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how may i get The position of the breadcrumb in the breadcrumb trail ?

https://i.imgur.com/QzAeErQ.png


BR
Mujeeb
See this function for creating the breadcrumb navigation:
https://crossreference.mybb.de/inc/funct...html#l4705

The position of elements relies on the array $navbits - if you wish to use the numbering of the breadcrum elements, then may rely on these variables to customize.

[ExiTuS]
<li property="itemListElement" typeof="ListItem">
    <a property="item" typeof="WebPage" href="{$navbit['url']}">
    <span property="name">{$navbit['name']}</span></a>
    <meta property="position" content="1">
  </li>


my question how may we put ListItem number ( auto increment) in content value of meta tag
You will need a plugin for it.
thank you , it is done without plugin by help of @Laird Sir
(2021-09-01, 01:29 PM)mujeebdgk Wrote: [ -> ]thank you , it is done without plugin by help of @Laird Sir

if you please explain here , all users would know about it for future reference.
Perhaps you could share the solution ?
(2021-09-01, 07:12 PM)Omar G. Wrote: [ -> ]Perhaps you could share the solution ?



<li property="itemListElement" typeof="ListItem">
    <a property="item" typeof="WebPage" href="{$navbit['url']}">
    <span property="name">{$navbit['name']}</span></a>
    <meta property="position" content="$key">
  </li>

only $key is solution
Sure, just note that $key can be 0, just for anyone reading this. Apart from that, it should be reliable, yes.