Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How do I add Breadcrumbs to my Vanilla Install?

UnderDogUnderDog MVP
edited December 2011 in Vanilla 2.0 - 2.8
This discussion was created from comments split from: Adding Page and Breadcrumb.

There are several other threads about breadcrumbs on the forums, but they haven't been answered. Rather than kicking an old topic (8 months!), it's better to start a new one and let's hope someone has an answer this time.

There was an error rendering this rich post.

Comments

  • I need this as well. :)

  • @Turbolego : Howcome you're bumping a thread that's almost 8 months old?

    There was an error rendering this rich post.

  • @UnderDog: I figured it would be better to continue on an unanswered thread rather than making a new one about the same issue.

  • I'll split it from the old one. I don't know if it's in the etiquette thread, but kicking an ancient topic could be one of the items.
    It's not breaking etiquette (like hijacking topics for example), it's just frowned upon. I frowned, therefore I split :-)
    I'll look in the code for your breadcrumbs until someone has an answer.

    There was an error rendering this rich post.

  • ToddTodd Chief Product Officer Vanilla Staff

    There's a echo Gdn_Theme::Breadcrumbs() function or {breadcrumbs} smarty tag. Try putting either one in your default.master.

  • edited March 2012

    @Todd: I guess you meant default.master.tpl??? or is it default.master.php???

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @badlearner

    Depends which theme you are using.

    AfaIk, if you have a .tpl you would use the smarty tag.

  • Okay, got it. Thanks @whu606

  • edited March 2012

    I have tried, but am unable to figure it out. There's no default.master.tpl in my theme

    or in /vanilla-root-directory/applications/dashboard/views/.

    Besides I don't know how to code, and definitely not PHP. It would be nice if someone who knows how to add breadcrumbs can provide some proper code.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @badlearner

    'proper code'?

    You've been given all the help you need to manage this.

    People have gone out of their way to provide you with the code you need, and instructions how to use it.

    If you don't have a custom theme then that's your issue.

    Changes like this are much better made in custom themes rather than tampering with the core.

    Follow the instructions here: http://vanillaforums.org/docs/themequickstart
    to create a custom theme folder you can then work in.

  • edited March 2012

    @whu606 : I am on my way into creating a basic custom theme. By proper code I only meant something like below that could be placed in a theme file:

    <?php echo Gdn_Theme::Breadcrumbs() ?> (this doesn't work)

    I wasn't demanding, nor was I rude. Your tone could be better. :)

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited March 2012

    So could yours - if you didn't meant to be demanding then perhaps you could take greater care in how you phrase things?

    Given that Todd is one of the creators of Vanilla, I think it likely that what he has given you is the 'proper code'.

    In your theme folder you should have a Views folder.

    In there should be a default.master file either .php or .tpl

    Which do you have?

  • edited March 2012

    So could yours - if you didn't meant to be demanding then perhaps you should take greater care in how you phrase things?

    I don't understand how you found my request demanding. Anyway, understanding is subjective, so let's set that aside. :)

    Now, what do you mean by 'theme folder'? Are you referring to '/themes/default/' directory? Then, no, there's no 'views' inside that. The only directory inside is 'design'. And since my custom theme is actually a copy of '/themes/default/' it also has only the 'design' folder.

    There's no default.master.php or default.master.tpl inside the 'views' folder in '/applications/vanilla/views/' either. But I found default.master.php in '/applications/dashboard/views/' folder.

    So, I created a folder named 'views' inside my custom theme, and copied the default.master.php from '/applications/dashboard/views/' to it. And now, my theme does have a default.master.php file.

    What should I do now?

    (I tried to make this explanative so that anyone coming here with the same doubts in mind can understand.)

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited March 2012

    @badlearner - OK - sorry if I got tetchy.

    Edit your themes default.master by adding this

    <?php echo Gdn_Theme::Breadcrumbs(); ?>

    directly after the <div id="Body">tag.

    That worked for me on my test site just now.

    By adding the div tag you can give it a class, and then set rules in your custom.css file for that class to style it the way you want.

    Remember to change the About.php file to give your theme a name, so that you can select it in the dashboard.

    The custom.css file only needs to contain any rules you want to add or change.

  • By adding the div tag you can give it a class, and then set rules in your custom.css file for that class to style it the way you want. The custom.css file only needs to contain any rules you want to add or change.

    Got it. Thanks!

    Remember to change the About.php file to give your theme a name, so that you can select it in the dashboard.

    Done!

    Edit your themes default.master by adding this...

    I added it. But nothing shows up. I am still checking...

  • @whu606 : Okay, i should have done better — I was editing admin.master.php instead of default.master.php file. DAMN!

    Anyway, the breadcrumb still doesn't seem to work. All I see is a link to 'Home'. On every page, it's just the same. Am I missing something?

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @badlearner - tbh I don't use it myself.

    The 'Home' link showing up means that the 'Breadcrumbs' are being called up (inspecting with Firebug shows it is part of the span class 'Breadcrumbs'), but how it is meant to work after that I don't know.

    If no one gives you an answer here, it may be worth starting a new question asking about how it is meant to work, and if there are any settings for it.

  • Will do that. Thanks for the help so far. :)

Sign In or Register to comment.