开发者

How to create breadcumb for custom component in Joomla?

开发者 https://www.devze.com 2022-12-12 17:55 出处:网络
I have a custom component in which I want to have a breadcumb to help the user navigate the previous page visits. The basic feature in my component is to show our product releases. The workflow is:

I have a custom component in which I want to have a breadcumb to help the user navigate the previous page visits. The basic feature in my component is to show our product releases. The workflow is:

  1. The user select the Products menu item. A new page is shown that displays the product names.
  2. The user select a specific product name. A new page is shown that displays the releases for this product.
  3. The user selects a specific product release. A new page is shown with information about this product release. The user can in this page view other products that depends on this release.

I have tried to use the builtin breadcumb function for this:

$app =& JFactory::getApplication();

$pathway =& $app->getPathway();

$pathway->addItem("$productName", "index.php?option=com_rcs_products&view=product&productName=$productName&Itemid=$Itemid");

This correctly creates the breadcumb. But it only displays three levels:

Home - RCS Pr开发者_StackOverflow中文版oducts - FSPA2-1.2

When I navigate to a new release it displays:

Home - RCS Products - IPU2-2.0

I would like it to show:

Home - RCS Products - FSPA2-1.2 - IPU2-2.0

Is this possible?


Just add another item to the pathway:

$pathway->addItem("$productCategory", "index.php?blabla");
$pathway->addItem("$productName", "index.php?option=com_rcs_products&view=product&productName=$productName&Itemid=$Itemid");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号