Closed Bug 311823 Opened 19 years ago Closed 16 years ago

advanced breadcrumbs syntax (generate from the contents of the tag, rather than from the page name)

Categories

(developer.mozilla.org Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: asqueella, Unassigned)

References

()

Details

Attachments

(2 files)

Breadcrumbs is a nice extension, but it works from the page names. This is
useful for pages that use the "Section:subsection:actual-name" naming, but not
for articles and other pages that use simpler naming scheme, like "Building an
Extension".

I proposed an advaced breadcrumbs syntax that would allow it to be useful for
the articles with short names (see the first part of
http://mail.mozilla.org/pipermail/devmo-general/2005-August/000328.html ). The
suggestion is to put the information about structure inside the <breadcrumbs>
title, like this: <breadcrumbs>Extensions:Articles</breadcrumbs>.

Another thing not mentioned in my mailing list post is that this could be useful
for "relatively short" names that we might use in the JS reference: e.g.
JS:Array instead of JS:Objects:Array. We'd like to use the shorter name so that
it's easier to link to, but have the breadcrumbs include a link to JS:Objects
page. So for JS:Array page,
  <breadcrumbs>JS:Objects</breadcrumbs>
would generate
  JS > Objects > Array

That is, get the "path" to the article from the text inside the tag, and the
name of article from the "leaf name" of the page or from the title-override tag
(similar to how it works now).
Assignee: deb → shaver
A version of Breadcrumbs.php that implements part one of the suggestion. Everything but findParents() had to be rewritten.

Not for review, as we need to decide what needs to be done with the "relatively short" pages, mentioned in comment 0. My original suggestion (taking the leaf name) might not be what we want (for page like [[JS:Array.prototype.substr]] with <breadcrumbs>JavaScript:References</breadcrumbs> the breadcrumbs should be JavaScript > References > Array > prototype > substr, i.e. only "JS" chopped off the page's name, not everything but the leafname). In case this was not understandable, either me or dria will post about it to devmo-general soon.
I have my own ideas on how to do this, but i am currently on a medical hiatus (e-mail me if you are curious), so if it is decided we need this _now_ be sure to thank Nickolay ;-)
Justin, did you mean you had your own ideas for the implementation or <breadcrumbs> syntax? In any case, please share them, as I am sure we need this sooner rather than later.
I think we have four possible options.

First, for either of these, if the breadcrumb element is empty, then the extension behaves as it currently does.  So JS:Array.prototype.substr, with "<breadcrumbs></breadcrumbs>", would have a breadcrumb output of "Main Page > JS > Array > prototype > substr".

The first option would be to automatically chop the initial prefix off if the breadcrumb element is not empty.  So on JS:Array.prototype.substr, "<breadcrumbs>Foobar</breadcrumbs>" would create breadcrumb output of "Main Page > Foobar > Array > prototype > substr".

The second option would be to insert the breadcrumb content between the initial prefix and the rest of the page name.  So on JS:Array.prototype.substr, "<breadcrumbs>Foobar</breadcrumbs>" would create breadcrumb output of "Main Page > JS > Foobar > Array > prototype > substr".

The third option would be to chop off all parts of the breadcrumb that are separated by ":" and maintain only the parts separated by ".".  So on a page named, for example, "JavaScript:Developer Handbook:Objects:Array.prototype.substr", "<breadcrumb>Foobar:Reference</breadcrumb>" would create breadcrumb output of "Main Page > Foobar > Reference > Array > prototype > substr".

The fourth option is a combination of the second and third, where all parts of the page name separated by ":" are chopped off except the initial prefix, and the breadcrumb element content is inserted in the middle.  So "JS:Developer Handbook:Objects:Array.prototype.substr" with a breadcrumb of "<breadcrumb>Reference</breadcrumb>" would output "Main Page > JS > Reference > Array > prototype > substr".

I'm also trying to keep in mind the possibility that a single page might end up with more than one breadcrumb, if that page is used by different people in different structures.  For example, the "CSS:@import" page could end up having "Main Page > CSS > Reference > @import" for one breadcrumb, and "Main Page > CSS > Tutorial > Using '@' Rules > @import" as another.  I don't think we should limit a page to a single breadcrumb trail.  The multiple-breadcrumb-trail thing isn't actually that relevant to this discussion, I just want people to keep it in mind when discussing these things.  If we're going to generate breadcrumbs independently of the page name, then it's quite likely that many pages will end up with multiple breadcrumb trails.
Nickolay, i had thoughts for both usage and implementation...

my ability to type without severe pain is heavily limited for at least two weeks, so i will try and make this short and sweet.

say we have "JavaScript:Developer Handbook:Objects:Array.prototype.substr"

and want to keep the JS but change "Devel...book"

<bread>[[JavaScript]][[FooBar:Reference]][[JavaScript:Developer
Handbook:Objects:Array.prototype.substr|Objects:Array.prototype.substr]]</bread>

could output:

JavaScript > FooBar > Reference > Objects > Array > prototype > substr

with proper links all along the way.  lets keep the normal wiki syntax to prevent a large learning curve.  if this can wait at the latest until january for me to explain my thoughts better, i would be happy, otherwise lets get this done someway now.
Looks like I will be doing this, based on mailing list decision for syntax/output.
Assignee: shaver → bugspam.Callek
Component: developer.mozilla.org → Infrastructure
Product: mozilla.org → Mozilla Developer Center
QA Contact: qa → infrastructure
Version: other → unspecified
Blocks: 339653
Can someone write, in this bug, exactly what the new syntax will be and produce, when the bug is fixed?  Thanks.
For sake of simplicity, I think that if the breadcrumb element contains any content at all that content should be treated as a full override of the page naming breadcrumbs.

So, if the pagename is DOM:window.navigator.appCodeName, an empty breadcrumbs element would continue to produce:

Main Page > DOM > window > navigator > appCodeName

But if the element were <breadcrumbs>DOM:DOM Reference:window:Puppies.are.cute</breadcrumb>, the breadcrumb would (assuming all the pages exist) generate:

DOM > DOM Reference > window > Puppies > are > cute > appCodeName

So, essentially, breadcrumb content does a full pagename override except for the last bit, which can be overridden using title-override.

Does that make sense?

No. I think we have settled on the way breadcrumbs should work a while ago on the list. I'll try to find or write the spec before the end of this week (just mailed Callek to see if he has anything handy).

Basically, breadcrumbs are formed recursively: title of the current crumb is determined just like now, and the rest of breadcrumbs are copied from the page specified inside the breadcrumbs tag (or parent page according to current rules, if nothing specified).

That's probably not elaborate enough, but that's all I can do without spending more time on it and/or re-reading the mailing list discussion.
Shaver, this is a copy of the mail I first described this with, let me know if you want me to further describe it in this bug, or answer any questions you have.
Attachment 224026 [details] doesn't mention title-override, which of course should continue to work. Shaver, are you happy with that description or should be put in the wiki and improved a bit?
I won't be working on this in the forseeable future.
Assignee: bugspam.Callek → nobody
not applicable anymore, since we've switched to deki.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Component: Deki Infrastructure → Other
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: