Heretic121
OMG Member
- Joined
- Sep 24, 2010
- Messages
- 446
Now when I started off, I had no idea what on earth "breadcrumbs" are or what to expect. So for those of you that don't know: It's the list of links which looks like arrows, or as my missus just said "They're tabs
"
Those (See image) are breadcrumbs.
Breadcrumbs are named so because they're there to "help you find your way back" (i.e. you leave a trail of breadcrumbs to follow it back to where you were).
Now to create breadcrumbs you will need to add them through your AdminCP (Administrative Control Panel) then go to Appearance and from there select templates. To add breadcrumbs it's a simple case of adding:
I've tried adding a foreach into the mix, like so:
But it would appear XenForo doesn't like that. I also tried loading the breadcrumb using PHP and returning the value into the template with a variable, but that didn't work either.
So it would appear that we're stuck with semi-static breadcrumbs, but I'm not entirely sure as you can load breadcrumbs using PHP but it's just not very ... clean.
[]
EDIT:
Thanks to Cezz for his help with creating breadcrumbs using PHP. It would appear that it is indeed possible to create multiple links using PHP. Simply using the follow code should do it:
Then you pass the array of links you want, renaming $links to whatever string you have as your "key". So if your array of links was called "breadcrumbs" like this:
Then you would use $breadCrumbs instead of $links.
[]
Even if you can't add multiple crumbs using PHP, or a foreach in XenForo, you can add them manually like so:
This would create two crumbs for one page. Using this you can as many as you need to add, but please only add crumbs if your user needs them and not if you just fancy having some extra.
You can also call phrases into your breadcrumbs. Like so:
This would make a breadcrumb and the label for it would be the one that you have saved for the phrase home, which is also the same phrase used for the first breadcrumb.
I think that's about all the explanation you'll need for this really, but if you have any questions, fire away and I'll attempt to answer them to the best of my knowledge.


Those (See image) are breadcrumbs.
Breadcrumbs are named so because they're there to "help you find your way back" (i.e. you leave a trail of breadcrumbs to follow it back to where you were).
Now to create breadcrumbs you will need to add them through your AdminCP (Administrative Control Panel) then go to Appearance and from there select templates. To add breadcrumbs it's a simple case of adding:
Code:
<xen:navigation>
<xen:breadcrumb href="http://www.thisisalink.com">Text</xen:breadcrumb>
</xen:navigation>
Code:
<xen:navigation>
<xen:foreach loop="{$links}" value="$link">
<xen:breadcrumb href="$link[1]">$link[0]</xen:breadcrumb>
</xen:foreach>
</xen:navigation>
So it would appear that we're stuck with semi-static breadcrumbs, but I'm not entirely sure as you can load breadcrumbs using PHP but it's just not very ... clean.
[]
EDIT:
Thanks to Cezz for his help with creating breadcrumbs using PHP. It would appear that it is indeed possible to create multiple links using PHP. Simply using the follow code should do it:
Code:
<xen:navigation>
<xen:breadcrumb source="$links" />
</xen:navigation>
PHP:
$Array = array (
'breadCrumbs' => etc, etc... // Array of links.
);
[]
Even if you can't add multiple crumbs using PHP, or a foreach in XenForo, you can add them manually like so:
Code:
<xen:navigation>
<xen:breadcrumb href="http://www.thisisalink.com">Text</xen:breadcrumb>
<xen:breadcrumb href="http://www.thisisaotherlink.com">Second Text</xen:breadcrumb>
</xen:navigation>
You can also call phrases into your breadcrumbs. Like so:
Code:
<xen:navigation>
<xen:breadcrumb href="http://www.thisisalink.com">{xen:phrase home}</xen:breadcrumb>
</xen:navigation>
I think that's about all the explanation you'll need for this really, but if you have any questions, fire away and I'll attempt to answer them to the best of my knowledge.