开发者

How To Include Breadcrumb Module On A Component for Joomla 1.6

I have a custom component that requires the standard Joomla breadcrumb module. I tried using the following and it didn't do anything:

<jdoc:include type="modules" name="position-2" />

Keep in mind this code开发者_运维百科 came from the template index file and I am trying to integrate the module into a custom component


That is not how to do it. This is for use in Joomla templates to include the module position. You need to make the breadcrumbs programmatically from within your component. See this tutorial on how to do this: http://docs.joomla.org/How_to_add_breadcrumbs

NB: Once you have done this ensure that you have the breadcrumbs module published and the position is set correctly for your specific template.

This link will also be useful - http://docs.joomla.org/JPathway/1.6

[EDIT]

Try add this in your view.html.php for your component:

$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem('Google', 'http://www.google.com');

This will add a breadcrumb that says "Google" and when clicked will link to www.google.com

In terms of creating your breadcrumbs you need to use your url to determine how far you are into you component e.g. "Home // Category // Weblinks" would have a url like:

http://www.domain.com/index.php?option=com_weblinks&cid=2:dogs&id=54:link-to-google

cid = 2 tells us that we are at least in the category, so we can add a breadcrumb for this.

id = 54 tells us we are looking at a weblink so we can add a breadcrumb for the page before which is the list of weblinks within the category

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜