Functions:pageBreadcrumbsFamilyGet

From Whirlwind eCommerce Wiki
Revision as of 11:03, 3 October 2008 by Root (Talk | contribs) (New page: == Description == retrieves data to be used to build breadcrumbs. Breadcrumbs are qualified by traversing the parents, grandparents, great grandparents and so forth until the top level is ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

retrieves data to be used to build breadcrumbs. Breadcrumbs are qualified by traversing the parents, grandparents, great grandparents and so forth until the top level is reached.

Syntax

$arrBreadCrumbs = eV::pageBreadcrumbFamilyGet($pageId[,$templateIdList]);

Paramaters

  • $pageId INT
the unique pageid that will be the breadcrumb target.
  • $templateIdList STR (optional)
Comma delimited list of templateIds that qualify a breadcrumb: if passed, only pages that are using a template from the list can be breadcrumbs. This is useful for filtering out cross sell relationships which qualify as children to product pages.

Return Values

Returns a multidimensional array where the first dimension is an indexed array of breadcrumbs, the second dimension is an associative array of breadcrumb data.

The returned array is as follows:

Array
(
    [0] => Array
        (
            [link] => STRING
            [text] => STRING
        )
    [1] => Array...

)

Elements from the breadcrumb associative array are as follows:

Element Description Example
link String: absolute URL link to the target breadcrumb's page /index.php?pageId=124
text String: the designated breadcrumb value for the target breadcrumb page. Category X

Examples

// get the breadcrumb data
$arrBreadcrumbs = eV::pageBreadcrumbsFamilyGet($pageId);
 
// display breadcrumbs
// place home page at beginning
echo "<a href=\"index.php\">Home</a>";
//traverse breacrumbs and display
foreach($arrBreadcrumbs as $breadcrumb) echo " &gt; <a href=\"" . $breadcrumb['link'] . "\">" . $breadcrumb['text'] . "</a>";
// place breadcrumb value for current page at end
echo " &gt; " . $breadcrumb;