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.

Need breadcrumbs to display home

Postby Steveman on Mon Sep 13, 2010 10:11 pm

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
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

Postby RamonS on Tue Sep 14, 2010 5:33 am

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]
RamonS
Senior Propellus Maximus
 
Posts: 4287
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Need breadcrumbs to display home

Postby Dave Lee on Tue Sep 14, 2010 7:35 am

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).
Dave Lee
Master Propellus Maximus
 
Posts: 5654
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Need breadcrumbs to display home

Postby LTinker68 on Tue Sep 14, 2010 9:16 am

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.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Need breadcrumbs to display home

Postby Steveman on Tue Sep 14, 2010 1:40 pm

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
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

Postby LTinker68 on Tue Sep 14, 2010 3:55 pm

Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Need breadcrumbs to display home

Postby Rona Kwestel on Mon May 23, 2016 3:30 pm

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> &gt; <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.
Rona Kwestel
Sr. Propeller Head
 
Posts: 208
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Postby Dave Lee on Tue May 24, 2016 12:09 am

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> &gt; </span>
        <MadCap:breadcrumbsProxy />
        <MadCap:bodyProxy />
        <script type="text/javascript">/*<![CDATA[*/$("#home-link").prependTo("div.MCBreadcrumbsBox_0");/*]]>*/</script>
    </body>
Dave Lee
Master Propellus Maximus
 
Posts: 5654
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Need breadcrumbs to display home

Postby Rona Kwestel on Wed May 25, 2016 9:36 am

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> &gt; </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.
Rona Kwestel
Sr. Propeller Head
 
Posts: 208
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Postby Dave Lee on Wed May 25, 2016 10:20 pm

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.
Dave Lee
Master Propellus Maximus
 
Posts: 5654
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Need breadcrumbs to display home

Postby Rona Kwestel on Wed May 25, 2016 10:28 pm

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.
Rona Kwestel
Sr. Propeller Head
 
Posts: 208
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Postby Dave Lee on Thu May 26, 2016 12:06 am

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.
Dave Lee
Master Propellus Maximus
 
Posts: 5654
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Need breadcrumbs to display home

Postby Rona Kwestel on Thu May 26, 2016 6:37 am

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.
Rona Kwestel
Sr. Propeller Head
 
Posts: 208
Joined: Wed Apr 04, 2007 11:50 am

Re: Need breadcrumbs to display home

Postby hoffie4 on Wed Nov 30, 2016 12:59 pm

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> &gt; </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.
hoffie4
Propeller Head
 
Posts: 25
Joined: Wed Sep 07, 2016 12:29 pm
Location: San Diego, CA

Re: Need breadcrumbs to display home

Postby Dave Lee on Thu Dec 01, 2016 12:52 am

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.
Dave Lee
Master Propellus Maximus
 
Posts: 5654
Joined: Mon Mar 05, 2007 8:33 am
Location: UK


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest