| Summary: | [navigation] Please add breadcrumb like navigation on eclipse.org | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Community | Reporter: | Andrey Loskutov <loskutov> | ||||||
| Component: | Website | Assignee: | Denis Roy <denis.roy> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | chris.guindon, edouard, ian.skerrett, mike.milinkovich, nathan | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 2014-Q2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Andrey Loskutov
Moving to the website. I hear you -- we definitely need breadcrumbs. When we redesigned our site ages ago, we discussed breadcrumbs but didn't come up with an easy way to define/manage them (other than manually) and the issue simply never resurfaced. I think the directory structure of our site is stable and well defined to the point where we can make this happen at run-time by simply examining the URL and building a breadcrumb in one of our classes. For instance, eclipse.org/webtools/... then: Home > Projects eclipse.org/legal/ ... then: Home > About Us > Foundation > Legal eclipse.org/membership/... then: Home > About Us > Foundation > Membership etc... I'll target this for a Q3 deliverable. I have ideas. Retargetting... Retargetting ... I still have ideas. Nathan, do we have pixels for this in the Nova skin? > Nathan, do we have pixels for this in the Nova skin?
I'm sure we could fit this into the skin, definitely not this quarter tho. Setting Q4-2009 as tentative Target. If you've seen our staging website, you'll notice breadcrumbs are part of the skin. http://staging.eclipse.org/projects/ I'll provide Phoenix API similar to what's done with $Nav and $Menu, in that breadcrumbs will be set (an array of breadcrumb objects) and altered by a page, or via _projectCommon *** Bug 432475 has been marked as a duplicate of this bug. *** Created attachment 242069 [details]
Patch to implement breadcrumbs
Here's my first pass. The Breadcrumb class is nothing more than an array of Link() object, which, in turn, are composed of a Title, URL, Target (_self, _blank, etc) and an arbitrary level which is not used elsewhere.
I assume this will be called from header.php or something similar, just like we call Menu(). A sample implementation would look like this:
$pageTitle = "Eclipse newsgroups";
# Automatically generate breadcrumbs based on $_SERVER['PHP_SELF']
$B = new Breadcrumb();
# Let's insert a silly breadcrumb just because we can
$B->insertCrumbAt(1, "Test", "sometest.php", "_self");
# Let's see what the breadcrumbs are
# $Crumb is a Link object
foreach ($B->getCrumbList() as $Crumb) {
echo "<a href='" . $Crumb->getURL() . "'>" . $Crumb->getText() . "</a>";
echo " | " ;
}
If called by www.eclipse.org/newsgroups/test.php, you will obtain:
Home | Test | Forums | Eclipse newsgroups
^ ^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^
| | | `- The last crumb will yield a NULL getURL() and
| | | - should only be rendered as text. Value of $pageTitle
| | | - truncated to 35 characters
| | |
| | `-- Breadcrumb class mapped /newsgroups to "Forums" text.
| |
| ` - The silly breadcrumb we decided to insert
|
` - Home is always Breadcrumb(0) in the list.
I've pushed the breadcrumbs.class.php file to staging: http://git.eclipse.org/c/www.eclipse.org/eclipse.org-common.git/commit/?h=staging&id=5eae66c20bfcbe25e2ca951cbefb323eebdea441 Created attachment 242077 [details] eclipse_org_common-adding_removeCrumb.patch (In reply to Denis Roy from comment #10) > I've pushed the breadcrumbs.class.php file to staging: > > http://git.eclipse.org/c/www.eclipse.org/eclipse.org-common.git/commit/ > ?h=staging&id=5eae66c20bfcbe25e2ca951cbefb323eebdea441 Looks good Denis! I implemented this to the new solstice theme: http://git.eclipse.org/c/www.eclipse.org/eclipse.org-common.git/commit/?h=staging&id=4dd2e8b6cbd11b2ac4612b16ab35104c8c8b026a We will need to update $FirstLevel array to include everything that's not a project. For example, a page under legal includes a link to /projects: http://staging.eclipse.org/legal/privacy.php Home > Project > legal > Eclipse.org Privacy Policy I am also thinking we might want to be able to remove a link from the breadcrumbs. I am attaching a patch for this. +1! (In reply to Denis Roy from comment #12) > +1! I added my patch. I also updated the $FirstLevel array. Removing block #432342 since this functionality is ready for Solstice. Example: http://staging.eclipse.org/legal/termsofuse.php I am happy to report that we have breadcrumbs on eclipse.org. https://eclipse.org/eclipse.org-common/themes/solstice/docs/#section-breadcrumbs |