Jump to content

New SacredWiki Extension, BreadCrumbs2


Recommended Posts

Hey hey all. New extension in town and on the wiki. :lol:

 

For some time now I've been aware of the fact that our wiki can have breadcrumbs. For those unaware of the term you can read Wikipedia:Breadcrumb (navigation). We use this navigation technique here on the forum as you can see near the top of every page is a trail of links.

 

Yesterday I took a little time to add this feature to the wiki and got to know it a bit. At first it was a bit confusing and partly because the author page of the extension doesn't really explain it in lamens terms... None the less I've managed to create a bit of a test and seems to have turned out well. I'll throw some links out for everyone to look at and get an idea of what's been done. I used the BM pages to test this on.

 

A number of BM pages have been affected by the breadcrumb I created. Keep in mind that this feature does not automatically create breadcrumbs. The process is manual. The good thing about this is that a single breadcrumb can cascade into many pages instantly. It makes for the ability to have a precision navigational system. Let's start at the Combat Arts page.

You'll notice on this page the breadcrumb links just under the title of the page. Now, from the list of characters, click on Battle Mage Combat Arts. Now on this page again you see the breadcrumb but it's changed slightly. From the previos page to the present page you're on the breadcrumb link "Characters" has changed to Battle Mage. You could also go further in by clicking on the Fireball link and you'll see on that page as well the breadcrumb. The test breadcrumb I believe is somewhat incomplete though and could probably use some further tweaking.

 

Now. There are two breadcrumbs in action and here is where I, as well as anyone else, can create the breadcrumbs:

MediaWiki:Breadcrumbs

 

And here is the documentation of the feature and how to use it. Unfortunately not in the simplest of terms...

Mediawiki:Extension:BreadCrumbs2

 

This is the basic syntax when creating a breadcrumb:

* category name @ breadcrumb wikitext @ tab name @ site logo

And here are two that I made:

* Battle Mage Combat Arts @ [[Main Page|SacredWiki.org]] > [[:Battle Mage|Battle Mage]] > [[:Combat Arts|Combat Arts]]

 

* Combat Arts @ [[Main Page|SacredWiki.org]] > [[:Character Class|Characters]] > [[:Combat Arts|Combat Arts]]

 

I'll try and simplify the syntax.

 

* category name=(Whenever a page has the specified Category association this breadcrumb will have an affect and be visisble at the top of each of those pages)

 

@=(Suggests that the following text after the @ sign is the line of links that will appear at the top of the page)

breadcrumb wikitext=(This is where you put your trail of links. It is suggested to use > symbol to separate each link.)

 

tab name=(Not required and not sure how exactly this works yet)

 

site logo=(Not required and not sure how exactly this works yet)

 

 

So there you have it for the moment. Keep in mind that this feature is strictly dependant on categories. Only categorized pages can be affected by this feature.

 

 

Questions? Suggestions? Is this a waste of time?

 

 

Cheers! :D

Link to comment

Well, it's a nice feature and all since it improves navigation inside the wiki, however there's a problem. The page is in the mediawiki namespace, which means only admins can edit the page, which is kinda ineffective. =/

Link to comment

Oh dangit.... I'll see if I can make it accessable to all. Thanx for pointing this out Indy. :lol:

 

*some time later...*

 

Ok. I've adjusted the permissions of the Sacred Editor's team to allow editing in the Mediawiki namespace and thus enabling you all to edit the breadcrumb page. I think you'll need to log out and then log in to update your new permission to the database.

Link to comment

Nice, though I want to be sure that you know that now all the pages in the mediawiki namespace can be edited, which might not always be a good idea, though I doubt that anyone on the team has any bad intentions.

Link to comment

I hadn't considered that actually but I absolutely trust the team. :lol: As it turns out though there are only 3 pages in the Mediawiki namespace and none of them are of serious consequence.

 

Thanx for the mention though Indy. There's a great deal more that I don't know about the wiki so any info is great.

Link to comment

Sorry about the doubel post - but I finally read up on these and 2 things:

 

First - disregard my last post. I didn't understand how they work. Now I do.

 

Second, according to MediaWiki, you can change the location of the breadcrumbs page to be other than the default: (here is the beginning of the php code)

 

<?php

/***

* BreadCrumbs2.php

* @version 0.9

* @date September 6, 2007

* @author Eric Hartwell ( http://www.ehartwell.com/BreadCrumbs)

* @license Creative Commons Attribution 3.0

 

This extension generates "breadcrumbs" in the web navigation sense ("Where am I?")

 

To activate the functionality of this extension include the following in your

LocalSettings.php file:

require_once('$IP/extensions/BreadCrumbs2.php');

 

Offered to the community for any use whatsoever with no restrictions other

than that credit be given to Eric Hartwell, at least in the source code,

according to the Creative Commons Attribution 3.0 License.

***/

 

# Change these constants to customize your installation

define ("DELIM", '@'); // Delimiter/marker for parameters and keywords

define ("CRUMBPAGE", 'MediaWiki:Breadcrumbs'); // Default is 'MediaWiki:Breadcrumbs'

 

You can use a different delimiter or a different page quite easily, it appears.

Link to comment

Ah! Very interesting gial. That would be a much better solution. Allowing everyone to create breadcrumbs would be cool. Well... Cool for anyone crazy enough to be compelled to make them, lol. Like me... :cow_white:

 

Something else I'm trying to discover is how to remove the subtitle names now. Every since I added this feature there have been duplicate page names on every page. For example on the main page where a breadcrumb would be placed there is a mini subtitle. Sort of like:

 

Main Page

Main Page

 

I'm not terribly concerned with this particular page but when it comes to pages like Battle Mage Combat Arts I am seeing duplicates at the end of its breadcrumb. :) I've gone to other wikis who use the breadcrumb feature and I noticed that they don't have this extra name tag tacked to the end of their breadcrumbs. What's more is that pages that haven't any breadcrumb on those other wikis do not suffer the subtitle like our Main Page has. I need to figure out how to shut off this default suptitle and if you happen upon I would love to know.

 

I'm going to check closer into that code you've provided gial. Thanx! ;) Hmmmm, I wonder if Special:Breadcrumbs would be a good place for it...

Link to comment

The duplicate text in the breadcrumbs is not really exactly duplication. The breadcrumb logic inserts the links back based upon all of the categories that the page belongs to . . .

The page 'Battle Mage Combat Arts' was in the Category "Battle Mage Combat Arts"; hence 2 entries -- one for the category, one for the page. I took it out of that category and it looks OK now, I think. (Same for Combat Arts, too)

As to the other pages, I'll bet turning breadcrumbs on forced subtitles on too -- since the breadcrumb is replacing the subtitle. I'll bet its an All or Nothing gambit for the crumbs.

 

Also, as I think on this, we definitely need an open tree structure or things will get confusing:

 

Not sure if this would be the case anywhere in the SacredWiki, but lets say a page derives from 2 different categories:

 

A "Is A" B and

A "Is A" C

 

and for both of those

 

B "Is A" D

C "Is A" D

 

The breadcrumbs will try to write D > C > B > A (or possibly D > B > C > A)

 

when the correct hierarchy is either D > C > A or D > B > A

 

Also then, we will need to ensure that all pages are properly categorized or breadcrumbs won't work

 

Finally, notice the sample on the MediaWiki extensions page used [[:Category:<xxxx>|xxxx]]. Their crumbs go back to parent category pages rather than parent pages. This is not of too much concern, frankly I like this way better, but if we do use the categories, we'll need to update things a bit -- including creating some category pages that don't yet exist.

 

whew' who'd a thunk it

 

. . . Every since I added this feature there have been duplicate page names on every page. For example on the main page where a breadcrumb would be placed there is a mini subtitle. Sort of like:

 

Main Page

Main Page

 

I'm not terribly concerned with this particular page but when it comes to pages like Battle Mage Combat Arts I am seeing duplicates at the end of its breadcrumb. ;) I've gone to other wikis who use the breadcrumb feature and I noticed that they don't have this extra name tag tacked to the end of their breadcrumbs. What's more is that pages that haven't any breadcrumb on those other wikis do not suffer the subtitle like our Main Page has. I need to figure out how to shut off this default suptitle and if you happen upon I would love to know.

 

I'm going to check closer into that code you've provided gial. Thanx! :cow_white: Hmmmm, I wonder if Special:Breadcrumbs would be a good place for it...

Link to comment

Oh boy, lol. Ok. I tried to wrap my head around A "is A" B and the rest but I'm afraid it isn't sticking. :oooo: However, I think I understand what you've gotten at. Do you think we should try to limit the number of categories associated to a page so that each page is only part of one category when possible? I can certainly see that resolving the double name thing for the most part.

 

Ah and yes. I did try making the breadcrumbs the way it is explained on the Wiki extension page but wasn't to fond of the results. Since many of our wiki pages are being set up like indexes I find it much more attractive to have the breadcrumbs go to a page rather than a boring looking category page. Glad you agree. :D

 

As for "The breadcrumbs will try to write D > C > B > A (or possibly D > B > C > A)" I had thought after reading the following part from the wiki extension page that having multiple categories associated to a page would be of no consequence:

Note that BreadCrumbs2 uses the first match with the current page's namespace or one of the page's categories. For example, if the Breadcrumbs page contains:

 

* Navigation extensions @ [[Main Page|MediaWiki.org]] > [[:Category:Extensions|Extensions]] > [[:Category:Navigation extensions|Navigation]] >

* User interface extensions @ [[Main Page|MediaWiki.org]] > [[:Category:Extensions|Extensions]] > [[:Category:User interface extensions|User interface]] >

 

The breadcrumbs for this page would be MediaWiki.org > Extensions > Navigation > Extension:BreadCrumbs2 and not MediaWiki.org > Extensions > User interface > Extension:BreadCrumbs2 because the Navigation line comes first.

 

 

So shall we have only one category per page then? Is that the best option for this problem you think? It sounds right to me but then at this point of my fatigue anything and everything sounds just dandy, haha.

 

:)

Link to comment

As it turns out, the example used above is what I meant:

 

Battle Mage > Combat Arts > Battle mage Combat Arts

 

Using the greater than sign as a separator, whcih is "strongly" advised leads one tto think of the hierarchy as:

 

Battle Mage Combat Arts are a subset of , or belong under, Combat Arts -- they are and do

Combat Arts are a subset of, or belong under Battle Mage -- they are not

 

What we really have is two different hierarchies going:

 

Battle Mage > Battle Mage Combat Arts, and

Combat Arts > Battle Mage CoOmbat Arts

 

It makes sense to be able to link back to either parent, though. Just remember that if you link back to Combat Arts from Battle Mage Combat Arts, you won't have Battle Mage in the lst any more either.

 

I think multiple categories are fine, given this understanding. The Wiki will be more useful that way, too, I think.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up