如何在 Joomla 1.6 的组件上包含面包屑模块
我有一个需要标准 Joomla 面包屑模块的自定义组件。我尝试使用以下内容,但它没有执行任何操作:
<jdoc:include type="modules" name="position-2" />
请记住此代码来自模板索引文件,我正在尝试将模块集成到自定义组件中
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那不是该怎么做。这用于 Joomla 模板中以包含模块位置。您需要在组件内以编程方式制作面包屑。请参阅本教程了解如何执行此操作:http://docs.joomla.org/How_to_add_breadcrumbs
注意:完成此操作后,请确保您发布了面包屑模块,并且为您的特定模板正确设置了位置。
此链接也很有用 - http://docs.joomla.org/JPathway/1.6
[编辑]
尝试在您的组件的 view.html.php 中添加此内容:
这将添加一个面包屑,上面写着“Google”,单击时将链接到 www.google.com
在创建面包屑方面,您需要使用您的 url 来确定如何你有多远进入你的组件,例如“Home // Category // Weblinks”将有一个像这样的url:
cid = 2告诉我们我们至少在这个类别中,所以我们可以为此添加一个面包屑。
id = 54 告诉我们正在查看一个网络链接,因此我们可以为该页面添加面包屑,之前是该类别中的网络链接列表
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:
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:
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