Need breadcrumbs to display home

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
Steveman
Sr. Propeller Head
Posts: 110
Joined: Mon Jul 12, 2010 9:55 pm
Location: Palmerston North, New Zealand

Need breadcrumbs to display home

Post by Steveman »

Hi,
I have successfully added a breadcrumbs proxy to my Webhelp and that all works fine. One question though. My linked project looks very similar to the examples that you see in the Flare Help topic about breadcrumbs where I have a Welcome page thats all by itself. How do I get that page to always show as "Home" on the breadcrumbs? When you select the "Home" button on webhelp it goes back to that page correctly as that is the page that I set as the opening page.

But in breadcrumbs each one only goes back as far as the book that its part of. If that makes sense. So when you select one of the books the "you are here" bit starts with the title of that book. I'd like them all to start with "Home". Is it something to do with the welcome page not being the top of the TOC? Do I have to make that the top book and everything else is a subset of that?
Carp diem - Seize the fish
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Need breadcrumbs to display home

Post by RamonS »

The only idea I have is to add a static Home link in front of the breadcrumbs proxy. That will only look right when you can edit the proxy properties to not include the "You are here:" text, but rather add that manually as static text in front of your home link. So it will basically be:
You are here: <home link> > [modified breadcrumbs proxy]
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Need breadcrumbs to display home

Post by NorthEast »

Steveman wrote:Is it something to do with the welcome page not being the top of the TOC? Do I have to make that the top book and everything else is a subset of that?
Yes, to get it working (without any workarounds), you'd need your home page topic as a single book at the root of your TOC.
I personally find that looks a bit funny in the Contents pane (as you don't initially see anything), but on the other hand it does mean you can navigate around your help fully using the breadcrumbs (and mini-TOCs).
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Need breadcrumbs to display home

Post by LTinker68 »

Or you could create a second masterpage that doesn't have a breadcrumb proxy and apply that masterpage just to the welcome page and all other topics use the other masterpage that has the real breadcrumb proxy. So your welcome page doesn't have any breadcrumb at all and all others do. I did that because having just the word "Home" by itself looked a bit weird to me, especially since it wasn't a link, so I removed the breadcrumb from the welcome page altogether.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Steveman
Sr. Propeller Head
Posts: 110
Joined: Mon Jul 12, 2010 9:55 pm
Location: Palmerston North, New Zealand

Re: Need breadcrumbs to display home

Post by Steveman »

This is probably a dumb question but how do you apply a second masterpage to a topic for online content? Or rather, I know how to do a second masterpage, I'm just not sure where you apply it to the topic. I've only managed to apply it for a target but not sure where it is for a single topic.
Carp diem - Seize the fish
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Need breadcrumbs to display home

Post by LTinker68 »

Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Post by Rona Kwestel »

Resurrecting this thread.
RamonS wrote:The only idea I have is to add a static Home link in front of the breadcrumbs proxy. That will only look right when you can edit the proxy properties to not include the "You are here:" text, but rather add that manually as static text in front of your home link. So it will basically be:
You are here: <home link> > [modified breadcrumbs proxy]
I tried this, but it seems to put the "Home" link on a separate line from the breadcrumbs proxy.

Here is what the code looks like in the master page:

Code: Select all

        <div class="content">
            <div id="contentBody">
                <div class="row collapse">
                    <div class="sideContent">
                        <div class="clearfix">
                            <MadCap:topicToolbarProxy />
                        </div>
                        <!--<MadCap:menuProxy style="mc-context-sensitive: True;" data-mc-skin="/Project/Skins/SideMenu.flskn" />-->
                    </div><a href="KB_Home.htm">Home</a> > <MadCap:breadcrumbsProxy /><MadCap:bodyProxy />
                </div>
            </div>
        </div>
And here's what it looks like in the output:
Breadcrumbs.png
In addition to the line separation, there is the issue of styling, since our links are styled differently from the breadcrumbs. I suppose for that I'd need to create a special class of link styling, no?

Thanks for any help.
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Need breadcrumbs to display home

Post by NorthEast »

You can do this fairly simply using a short script.

This is an example of a master page:
* The link to the home topic is inside a span tag with an ID of 'home-link' (#home-link).
* A jQuery script uses prependTo to move the link (#home-link) inside the breadcrumbs container (div.MCBreadcrumbsBox_0) in the output.

Code: Select all

    <body><span id="home-link"><a href="KB_Home.htm">Home</a> > </span>
        <MadCap:breadcrumbsProxy />
        <MadCap:bodyProxy />
        <script type="text/javascript">/*<![CDATA[*/$("#home-link").prependTo("div.MCBreadcrumbsBox_0");/*]]>*/</script>
    </body>
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Post by Rona Kwestel »

Thanks, Dave, that worked! The one thing I had to do to make the hyperlink styles match was to add the MCBreadcrumbsLink class to the anchor tag:

Code: Select all

<span id="home-link"><a class="MCBreadcrumbsLink" href="../../KB/KB_Home.htm">Home</a> > </span>
<MadCap:breadcrumbsProxy />
<MadCap:bodyProxy />
<script type="text/javascript">/*<![CDATA[*/$("#home-link").prependTo("div.MCBreadcrumbsBox_0");/*]]>*/</script>
I don't profess to know javascript in partiuclar, but even if I knew that there was a prependTo function, how do you know that there is a "div.MCBreadcrumbBox_0" to which to prepend your anchor object? Do you have to look at the Madcap generated code to figure that out?

Thanks again.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Need breadcrumbs to display home

Post by NorthEast »

Rona Kwestel wrote:I don't profess to know javascript in partiuclar, but even if I knew that there was a prependTo function, how do you know that there is a "div.MCBreadcrumbBox_0" to which to prepend your anchor object? Do you have to look at the Madcap generated code to figure that out?
Yes, I had to look at the HTML of the generated output. I'm guessing you did too, to figure out there was a 'MCBreadcrumbsLink' class.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Post by Rona Kwestel »

Thanks, Dave, that's what I figured. I would certainly prefer a more straightforward way to achieve this, but at least it works.

Actually, the MCBreadcrumbsLink class is in the style sheet:

Code: Select all

a.MCBreadcrumbsLink
{
	color: #696969;
	font-style: italic;
	text-decoration: underline;
}
And pardon my "peucliar" misspelling of particular.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Need breadcrumbs to display home

Post by NorthEast »

Rona Kwestel wrote:Actually, the MCBreadcrumbsLink class is in the style sheet:
It's not in your source stylesheet by default; so if it is, then someone must have added it there.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Post by Rona Kwestel »

Well, the only someone on this project, currently, is me, so I must have added it, but perhaps indirectly by editing those settings in the Stylesheet Editor at some point. Otherwise, I normally just edit the stylesheet in the Internal Text Editor.
hoffie4
Propeller Head
Posts: 27
Joined: Wed Sep 07, 2016 12:29 pm
Location: San Diego, CA

Re: Need breadcrumbs to display home

Post by hoffie4 »

Dave Lee wrote:You can do this fairly simply using a short script.

This is an example of a master page:
* The link to the home topic is inside a span tag with an ID of 'home-link' (#home-link).
* A jQuery script uses prependTo to move the link (#home-link) inside the breadcrumbs container (div.MCBreadcrumbsBox_0) in the output.

Code: Select all

    <body><span id="home-link"><a href="KB_Home.htm">Home</a> > </span>
        <MadCap:breadcrumbsProxy />
        <MadCap:bodyProxy />
        <script type="text/javascript">/*<![CDATA[*/$("#home-link").prependTo("div.MCBreadcrumbsBox_0");/*]]>*/</script>
    </body>
I have just tried Dave's solution to prepend text to the the breadcrumbs container and it has worked incredibly well. But I've run into and issue where the breadcrumb text is also added to the Search Results page and any other pages that don't have breadcrumbs. This isn't a huge deal for pages that aren't in the TOC and thus normally show no breadcrumb trail, but I don't want the home link to display on the Search page.

Is there any way to prevent this from happening? The only way that I can think of is to have the default master page not include the prepended text and apply a separate master page with the prepended text to every topic page in the project (which is not a very workable solution).


EDIT

I found that if I create a span class (span.NoShow) and then directly open the MainStyles stylesheet and add an html.templateTopic span.NoShow with display set to none, that will solve the issue. The text prepended to the breadcrumbs will NOT show on the search page, but will still show on pages that aren't in the TOC.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Need breadcrumbs to display home

Post by NorthEast »

If it's just the search page that you don't want breadcrumbs on, you could create your own search topic (i.e. a topic with search results proxy), and set that to use a different master page without the breadcrumbs. The rest of your help can use the default master page with breadcrumbs.
Post Reply