Help Wikitravel grow by contributing to an article! Learn how.

Wikitravel talk:Breadcrumb navigation

From Wikitravel
Jump to: navigation, search

Breadcrumb navigation is here[edit]

Breadcrumb navigation is here! Coolness! Is this enabled across all Wikitravel language versions now, assuming the proper templates are migrated etc? Jpatokal 03:27, 8 Dec 2005 (EST)

District pages look a little fugly if you try to add the IsIn code:
Singapore/Bugis
From Wikitravel
< Singapore
Asia : Southeast Asia : Singapore : Singapore/Bugis
Any way to make this look prettier? Something like this would be better:
Singapore/Bugis
From Wikitravel
Asia : Southeast Asia : Singapore : Bugis
< Singapore
Jpatokal 03:31, 8 Dec 2005 (EST)
It's enabled across all Wikitravel versions. It doesn't work well with sub-pages ("Page/Subpage") yet; we should probably discuss how we're going to deal with that. For now, I'll get rid of the "< " stuff, and make the sub-page navigation fit seamlessly into the "isin" navigation. Actually, if that's the case, you shouldn't have to bother putting "isin" stuff into sub-pages, since I can figure it out from the name... hmm.
In any event, yes, fun stuff. Let's get Wikitravel:Breadcrumb navigation started so we can document the process. --Evan 10:46, 8 Dec 2005 (EST)
So I should hold off putting isIns into district pages right? --Ravikiran 00:44, 9 Dec 2005 (EST)

It doesn't cover spaces into underscores? --Ravikiran 07:06, 8 Dec 2005 (EST)

No. What's happening under the covers is that the template is adding in-page RDF that describes the geographical hierarchy, and the breadcrumbing code just reads that RDF and builds navigation from it. It's pretty magical, but it does require that you use the "URL form" of the parent article's name. --Evan 10:46, 8 Dec 2005 (EST)

Doesn't work in ja-wikitravel?[edit]

I copied over Template:IsIn, but I can't make breadcrumb navigation work — even if I use all Latin characters (see [1]). What's wrong? Jpatokal 12:51, 11 Dec 2005 (EST)

Evan, I saw you played around with this, but it still doesn't work — any idea what the issue is? Jpatokal 23:14, 11 Dec 2005 (EST)
No, not yet. I'm going to experiment some more. It seems to be working on fr: (see fr:Australie) but I haven't tried on the other language versions. The error seems to be that PAGENAMEE isn't doing variable expansion in the RDF template... weird. Anyways, I'll try over the next couple of days. --Evan 00:37, 12 Dec 2005 (EST)
The problem occurs if the first letter of a site name is a non-ASCII character (for both linking and linked pages), ie {{PAGENAMEE}} returns a string starting with a percent sign. A solution is not only important for CJK languages but for all non-Latin and a lot of Latin-based languages, for instance German (examples de:Ägypten (Egypt) or de:Österreich (Austria)). Unger 06:21, 19 Dec 2005 (EST)
Unfortunately there's something more involved in ja:, because isIn doesn't work there even if the article name is entirely ASCII. Jpatokal 07:56, 19 Dec 2005 (EST)
Remark: Not only the name of the article itself must start with an ASCII character, but also the name of the article to be referred. For instance, the followings are impossible. (1) Nordarfika (North Africa) : Ägypten (Egypt), but also (2) Ägypten : Sinai. Then I added an X in front of Ägypten (XÄgypten) at the Sinai page, and in this case isIn was working. Unger 08:54, 19 Dec 2005 (EST)
OK, so, this is fixed for en:, de:, sv:, and now ja:. I hope someone else can copy the equivalents to the other language versions. --Evan 01:06, 6 April 2006 (EDT)

isIn more than one breadcrumb[edit]

moved from User_talk:Evan

You said in USA Talk -->I'm working on the code to show more than one breadcrumb list on the top of the page (we need it for a lot of areas, not just NM), so in the next week or so NM will appear in both regions.

I think that is great! and very much needed. Would it be okay to add add'l isIn's in areas that I work? Thanks! Xltel 15:25, 21 Jan 2006 (EST)
Absolutely; note that right now the last isIn template is the one that will be listed, so try to list add'l ones before it. Let's discuss this on Wikitravel talk:Breadcrumb navigation. --Evan 15:29, 21 Jan 2006 (EST)

I can see several places where this would be useful, I already figured out that last wins for now based on your edits. I can use this in the Ozarks and I know there are other areas that have this problem. Thanks!!! Xltel 16:03, 21 Jan 2006 (EST)

So let's suppose we have

It Would Be Nice (tm) if we could have some kind of "directed breadcrumbing" where Eureka Springs' breadcrumb navigation pointed backwards only to Arkansas, and skipped the Oklahoma and Missouri paths. Hypothetically, if we marked Eureka Springs as {{isIn|Ozarks}} {{isIn|Arkansas}} you could infer the path. Use whatever mechanism and syntax you like. I see many examples where this would come in handy. -- Colin 22:57, 8 March 2006 (EST)

Albury-Wodonga and the other Australian twin cities (which are in two states) also could use two isIns. Hypatia 17:34, 10 September 2006 (EDT)

System down[edit]

Sorry to be the bearing of bad news, but it seems that the breadcrumb navigation system is not functioning again. Check:Cotswolds WindHorse 18 Feb 06

It is now. --Ravikiran 08:49, 18 Feb 2006 (EST)
It looks fine to me. Can you be more specific, WH? --Evan 08:57, 18 Feb 2006 (EST)
Problem wasn't in the system. He'd put in the braces incorrectly. I fixed it. False Alarm --Ravikiran 09:01, 18 Feb 2006 (EST)
Sorry Evan. Thanks Ravikiran. I checked everything - but the braces by the sound of it. Anyway, it is lucky for me. Didn't they used to chop of the heads of bearers of bad news in Medaivel England!?! WindHorse 18 Feb 06

Escape parantheses[edit]

"The argument to the "IsIn" template must be in URL form. That is, spaces should be replaced by underscore ("_"), and non-URL characters like parentheses must be URL-escaped."

I don't think parantheses need to be escaped. I haven't been doing so and haven't had any problems -- see for example Contra Costa County. Is there some browser or some special circumstance where this is required, or can this warning be removed? -- Ryan 12:54, 4 March 2006 (EST)

Me too. I've been lazy and neeglecting to escape parantheses. I haven't faced problems, either in FF or IE. --Ravikiran 13:13, 4 March 2006 (EST)
Yeah, it's true. I think it's OK to have non-URL chars, but you _do_ have to do the underscores. --Evan 16:25, 4 March 2006 (EST)

Why a script?[edit]

Probably there is a good reason why a script is used for this Breadcrumb feature. The feature is beautiful and I love it. But it got me thinking, why a script? An alternative (that might not scale well with many people using it but I don't know that and it comes to mind) might be to simply use Templates one instide another something like this:

(spaces inserted in markup below to escape rendering)

On a Palo Alto page { {Palo Alto} }
On a Template:Palo Alto { {Bay Area} } : [ [Palo Alto] ]
On a Template:Bay Area { {California} } : [ [Bay Area] ]
On a Template:California { {USA} } : [ [California] ]
On a Template:USA [ [USA] ]

('SF Bay Area' probably better that 'Bay Area' to keep it unique, but above is just for example)

Seems to work for me on my own MediaWiki without any script and to not require underscore in names.

Just thinking... --Rogerhc, 6 March 2006

It's not a script, it's a Mediawiki extension, which uses RDF markup in the output of a template called "isIn". -- Mark 01:12, 10 March 2006 (EST)

More about the sub-pages ("Page/Subpage") / district articles[edit]

Examples where the breadcrumbs displayed don't refect what the isIn says:

Richmond (Virginia)/The Fan isIn Richmond_(Virginia)/Central -- North America : United States of America : South : Virginia : Central Virginia : Richmond : The Fan

New York (city)/Soho isIn New_York_(city)/Manhattan -- North America : United States of America : Mid-Atlantic : New York (state) : New York : Soho

New York (city)/Morningside Heights isIn New_York_(city)/Manhattan -- North America : United States of America : Mid-Atlantic : New York (state) : New York : Morningside Heights

The breadcrumb navigation functionality short-circuits for sub-pages. It doesn't even check for the RDF code -- it just assumes that X/Y is in X. I'll see what I can do to change that. --Evan 20:21, 6 March 2006 (EST)

Commas - the most common "problem" character?[edit]

Just in case it's somehow possible: it would be great if (for example) {{isIn|Durham_(region,_Ontario)}} would work, instead of having to use {{isIn|Durham_(region%2C_Ontario)}} - not just for lazy/forgetful people like me, but for all non-expert/non-techie types.

Template does not yet work if names contain non-ASCII characters[edit]

This is only a commemoration, because the IsIn template does not work on Japanese and some German pages where names use Japanese characters or German umlauts (especially at the beginning of the page name). Unger 01:37, 13 March 2006 (EST)

It's an error in the template, not the RDF code, it turns out. I changed de:Template:IstIn, and I guess I should probably copy something similar over to ja:, too. --Evan 00:53, 6 April 2006 (EDT)
It's working at the German Wikitravel. Unger 11:09, 6 April 2006 (EDT)

Downloading/sharing the template[edit]

This template version of breadcrumbs is great, and has very simple applications that using categories just cant cover.

Is there any way we can get our hands on the code for this template to use in other mediawiki installations?

Or can you even just give us a run down on how to create a similar breadcrumbs navigation tree ourselves? Thanks.

We're interested in adapting this breadcrumb system to our needs for developer documentation at Mozilla. It looks like you guys have a custom extension to process the RDF data and actually create the breadcrumbs; is this something that's available or will we have to develop our own? 24.151.172.59 12:41, 20 March 2007 (EDT)

It's available; email me at evan@wikitravel.org and we can synch up a bit. I'd love to talk more about dev., anyways. --Evan 12:53, 20 March 2007 (EDT)

Activities[edit]

Golf in Australia is currently marked {{isIn|Australia}}. Is this an intended use of the template? The project page doesn't seem to say either way. Hypatia 04:32, 22 July 2006 (EDT)

Truncation of Breadcrumbs[edit]

I've run into this before, but can't seem to fix it here. The order that the isIn is saved seems to affect how the breadcrumbs are saved. Currently my problem is with Napa, Napa Valley and Bay Area (California). If you move the isIn and save (like I did here with Bay Area to try to fix the initial problem with the upper hierarchy not showing (i.e. California and higher wasn't showing above Bay Area on the Napa Valley page, then the hierarchy goes away. Wow, dunno if I made that clear. OldPine 18:33, 31 July 2006 (EDT)

I fixed it down to Napa using a complicated process involving the purge command, a squirrel, and jumping up and down on one foot. It'd be nice if this process was automatic or something. I think the root of it is something like "if the parent isn't in the cache, the breadcrumb trail for the child don't work". -- Colin 18:58, 31 July 2006 (EDT)
I think it's extremely important to note for the record, in case anyone is worried, that no squirrels were harmed during the performance of this maneuver. -- Ryan 19:01, 31 July 2006 (EDT)
Dudes! You be geniuses as usual! You explain like a genius, too. Can I use your squirrel for Calistoga, too?. And what the heck is a purge command. Damn. I'll never make Admin. (Which is OK :)) OldPine 19:03, 31 July 2006 (EDT)
To purge, click on the 'history' tab. Then edit the URL at the top of your browser to change 'history' into 'purge', then return to perform the purge. Then I usually have to click 'discussion' then click 'article' again to get the right version. I'm unsure whether you have to perform the purge-n-binge from the top down, or if it suffices to just purge-n-binge the article, I'll have to ask that squirrel as soon as I figure out where I threw him. Darn things hate being swung by their tails. -- Colin 19:14, 31 July 2006 (EDT)
Durn squirrel is fast, but it's the moose you gotta watch out for. Thanks, Colin. OldPine 19:19, 31 July 2006 (EDT)

Breadcrumbs and article status tag order[edit]

I see people changing the order that these are in. Typically they are putting the article status (e.g. outline ) below the isIn|xxx. I my drive to Do Everything Right(tm), I am curious as to the reason/necessity for this. OldPine 06:51, 25 September 2006 (EDT)

Apparently the breadcrumbs work more reliably if they are above the article status - exactly why I don't know, but I've seen in mentioned more than once (on talk pages, don't think I've seen it on an actual "policy" page).
In addition, I think it makes sense to have the isIn and status right at the very bottom, as they are the most likely of the bottom-of-the-page-stuff to need editing (especially status, as the article progresses from outline to star; also isIn as the guide hierarchy becomes more complete and stuff gets shuffled around), and easy to navigate to if you know you want the very last line. ~ 203.144.143.3 08:07, 25 September 2006 (EDT)

IsIn template without underscores and such[edit]

One of the minor (major?) problems we've had with Template:IsIn, and other RDF-containing templates, is that the arguments to the template have to be URL-encoded (non-ASCII characters are changes to %XX), and spaces need to be converted to underlines. With the upgrade to MediaWiki 1.8.2, there are now functions built into MW to do this. So we can start changing these templates so they don't need to have encoded input.

Changing IsIn and other templates so that they expect unencoded input rather than encoded input would mean that huge numbers of pages won't work correctly. One way to do this kind of changeover is to create a new template (like Template:IsPartOf) that expects unencoded input, and use that for new pages. We could then gradually convert the older pages with Template:IsIn to use the new template.

Then again, it may not be that urgent a problem. Any ideas for how, or whether, to do this? --Evan 17:20, 17 October 2006 (EDT)

Not sure if this would work, but... it seems to me that underscore and percent-escapes never occur in the proper names of destinations. If you installed ParserFunctions, you could use #pos to grep for those two chars and then use #if to select between passing the text raw or encoding it first. -- Colin 17:56, 17 October 2006 (EDT)
We actually have ParserFunctions installed, so that might be a good way to do it. It's worth some further experimentation. --Evan 18:14, 17 October 2006 (EDT)
My bad. #pos is a StringFunction. --Colin 19:04, 17 October 2006 (EDT)
The isPartOf coding seems to work with our without underscores... so why can't we just copy that code into the isIn template to save the better-named and easier to use one? Names that were previously underscored for the isIn template should still work. Am I missing something else? – cacahuate talk 19:42, 25 June 2007 (EDT)
OK, I missed the parentheses part... it doesn't work with url-style ones (New_York_%28city%29). Can't someone whip up a bot or something to go through and change them into parentheses? I personally would much rather keep isIn working and change the code to work like isPartOf than switch to isPartOf – cacahuate talk 19:53, 25 June 2007 (EDT)
If it means having only one template, I'd be in favor of using the isPartOf code for isIn, fixing broken isIn's as we find them, and converting all isPartOf's to isIn's and then deleting isPartOf when it is unused. It's a bit of work, but it's easy, we would just need to gain consensus that it's a good idea. -- Ryan • (talk) • 20:17, 25 June 2007 (EDT)
I would support this. To clean up the breadcrumbs we could just hire the birds from Hansel & Gretel. Or unleash the fastest dog ever. --Peter Talk 21:48, 25 June 2007 (EDT)
Ha! I think they'd make a good combination! And a Jani-bot would make a deadly threesome – cacahuate talk 22:12, 25 June 2007 (EDT)
Bump! Any additional comment re: updating the isIn code, getting rid of isPartOf, and fixing broken isIn's as they are found? -- Ryan • (talk) • 17:14, 26 June 2007 (EDT)
Seems like the obvious thing to do. Pashley 19:41, 26 June 2007 (EDT)
All seems sensible to me. Gorilla Jones 19:55, 26 June 2007 (EDT)
Agree, improve "IsIn", change uses of "IsPartOf" to be "IsIn", clean up problem cases. (Not that I'm volunteering to steer the bot that cleans up the problem cases.) JimDeLaHunt 04:33, 27 June 2007 (EDT)
What a huge amount of busy work for 0.0% visible gain to contributors or readers. Please, let's use this amount of energy for making travel guides instead.
If people are worried about the funny characters, let's use IsPartOf from here on, deprecate IsIn, and at some point in the future I'll make IsIn work magically with either encoded and unencoded characters. --Evan
But if people are willing to do the work, and it clears up the confusion of having two templates that perform the same task, is there any harm? It seems like there is an interest in getting rid of the template duplication, and people have indicated they prefer the shorter "isIn" to "isPartOf", so I'm not sure I see the harm in making this change. -- Ryan • (talk) • 12:11, 27 June 2007 (EDT)
It's a problem with a simple technical solution (fix the IsIn template so it works like IsPartOf by default but if there's a % or _ in the input, it works like the old IsIn) that really shouldn't be done by hand. During the hand conversion, which may take months, tons of breadcrumb paths will be broken. At the end of that time... we'll have exactly the same breadcrumbs as now. The whole reason we use MW templates is so that we don't have to rewrite tens of thousands of articles by hand.
Let's do this: I've installed the StringFunctions extension (see Special:Version). Let's see if we can make a Template:SmartIsIn that acts either like IsIn or IsPartOf depending on if there's a % or _ in the argument. If it works, let's replace Template:IsIn with it. We can then go back and de-encode the existing IsIn uses at our leisure, if anyone's really hot to do that. --Evan
This sounds like a good plan to me. Great to see the bureaucracy in motion! --Peter Talk 14:22, 27 June 2007 (EDT)

That sounds great, anything we can do to save the better named and easier to type isIn! – cacahuate talk 21:19, 27 June 2007 (EDT)

I agree with the idea of fixing isIn and any links that that breaks. However, I'd like to keep IsPartOf as well, for use where there's a relationship but isIn doesn't fit. For example, several shorter intineraries are part of Overland_from_Singapore_to_Shanghai and Yunnan tourist trail is part of one route in Overland to Tibet. So perhaps isIn for places, IsPartOf for itineraries. Is the Related tag all we need for travel topics? Pashley 06:16, 28 June 2007 (EDT)

Pashley, it sounds like you are proposing a new template function, to identify shorter itineraries as part of longer itineraries, and reusing the IsPartOf name for that function. I think that's a separate discussion that belongs in a different place. Here we're talking about Breadcrumb Navigation and the templates that create it. JimDeLaHunt 14:25, 28 June 2007 (EDT)
We now have Template:Related that works for Pashley's concern – cacahuate talk 22:17, 2 July 2008 (EDT)

IsIn vs IsPartOf[edit]

(swept in from pub)

I can't believe this is not covered elsewhere, but I could not find it. What is the rationale for using one rather than the other. Should IsPartOf always be used? OldPine 09:31, 2 June 2007 (EDT)

I think it's a historical thing. IsIn was created, and everyone loved it and was happy. Then someone noticed that it broke badly for places with spaces or other non-alphabetical characters in the name, and the level of happiness declined. Evan then created isPartOf as a test to see if it fixed the problem, and the happiness level again increased. The downside was that we had a ton of articles that used isIn, but a much better solution in the form of isPartOf. Since isPartOf is a better solution I think it should replace isIn, but unfortunately we can't simply get rid of isIn since it's used in so many existing articles. If desired we could probably start a crusade to get rid of isIn altogether, much like 2005's war against the "External links" section, but prior to embarking on that battle it might be best to get other's opinions on whether or not it's worthwhile. -- Ryan • (talk) • 12:39, 2 June 2007 (EDT)
Ryan pretty much covered all there is to know, but in case anyone is interested, this was also discussed here. --Peterfitzgerald Talk 12:42, 2 June 2007 (EDT)

OK, Thanks. Seems way over my head so I'll just start using the new form. I trust there is a reason why the old template (IsIn) cannot just be changed, that is, fix the code. Is this not a job that a bot could run? (See IsIn, replace with IsPartOf?) Geez, nevermind. Why do I even think I can understand Geekiness on such I grand scale? :) OldPinw 13:06, 2 June 2007 (EDT)

The problem (as I understand it) is that IsIn requires the use of underlines and other kludges, but IsPartOf breaks if you use them. - Todd VerBeek 13:09, 2 June 2007 (EDT)
A key element of geekiness involves laziness. In this case, since nothing is actually broken we can procrastinate and avoid doing any additional work. If it HAD to be fixed then the laziness vs. work quotient (LVWQ) is applied to determine if it's worthwhile writing a bot. Basically, you guess how long it will take to write a bot (and this calculation is ALWAYS wrong by half) and compare that to how long it will take to fix by hand, taking into account the likelihood that someone else will deal with it. Note the special case where the person performing the calculations is too lazy to actually work out the solution, in which case you again default to hoping someone else will deal with it. -- Ryan • (talk) • 13:16, 2 June 2007 (EDT)

You know, I have been using IsIn because it is faster to type, but that's kind of silly. I'll add the IsPartOf to the article templates—it is marginally easier to edit. --Peterfitzgerald Talk 13:42, 2 June 2007 (EDT)

Ah, now that all rings a bell,Ryan. Guess I don't have the perspective. I was thinking that whipping up a bot is real easy since I've never actually done it... or even written a script in probably 10 years. It all seems so easy when you're sitting in the audience. Thanks, guys, for splainin' things to the old guy. OldPine 13:46, 2 June 2007 (EDT)

If for some reason we do go on a crusade or start a bot, I would suggest rather than changing IsIn's to IsPartOf's we should fix the IsIn template and then spend the work fixing the spaces and underscores. I also continue to use IsIn because I would much rather type that than IsPartOf, and it just has a much better ring to it. Lame, but true. On the new Hindi WT we've set up IsIn to work the way that IPO does here, though obviously a much easier task since we've only got like 20 articles. – cacahuate talk 03:26, 3 June 2007 (EDT)

I tend to use isPartOf by default these days since it just works better than isIn, but I agree with Cacahuate that a better solution will be to get isIn fixed and use that exclusively --NJR_ZA 05:10, 3 June 2007 (EDT)

We are currently trying to drum up consensus for a proposal to update the isIn code, get rid of isPartOf, and fix broken isIn's as they are found. Please comment here. --Peter Talk 18:33, 26 June 2007 (EDT)


Colons and breakage[edit]

We're working toward using this at Mozilla's documentation site now, but have encountered a problem. We have pages with colons in the name; this seems to badly break things. Changing the colons to %3A doesn't seem to fix anything. Any suggestions?

How does it badly break things? Any idea where it happens in the code? --Evan 15:03, 26 April 2007 (EDT)
Turns out the actual problem is that the extension doesn't work for namespaces other than NS_MAIN, and my test cases were all in the User namespace. Once I figured that out, everything's actually fine. 24.159.184.104 14:05, 27 April 2007 (EDT)

SmartIsIn[edit]

Regardless of your position on IsIn or IsPartOf, the SmartIsIn template created above is unused, and unnecessary when using isPartOf. I'm not sure it is appropriate for a vfd, but nevertheless I think it should be removed to avoid confusion. Any views to the contrary? --inas 20:08, 8 July 2009 (EDT)

Nuke it. Jpatokal 22:38, 8 July 2009 (EDT)

No ispartof on districts..[edit]

I've suggested formalising the omission of the isPartOf template on districts here. It anybody has an opinion they can express it there. --inas 01:48, 10 July 2009 (EDT)

Encouraged use of IsIn[edit]

The edit screen still encourages the use of IsIn. Right below Save Page and Show Preview is a template shortcut for IsIn. How do we update this to IsPartOf? Jtesla16 14:56, 18 July 2009 (EDT)

Should be fixed now [2]. --Peter Talk 15:32, 18 July 2009 (EDT)

IsPartOf Tag[edit]

Swept in from pub:

Is there are a way to view all articles that are marked as part of another with the IsPartOf tag?

Specifically, I am trying to identify all articles which have been marked IsPartof Bali.--Burmesedays 10:20, 6 September 2009 (EDT)

Sadly, no. The best I've got for you is to use the search function to look for "{{IsPartOf|Bali}}". LtPowers 10:24, 6 September 2009 (EDT)
Thanks. I really ought to have thought of that myself. A search for each of IsPartOf|Bali and IsIn|Bali seems to do the trick. --Burmesedays 10:39, 6 September 2009 (EDT)

Variants

Actions

Destination Docents

In other languages