[英]Joomla 3.x custom component view is shown in wrong template design
I am developing a custom component. 我正在开发一个自定义组件。 In this component I need Joomla's Redirect with its inbuilt function
JRoute
for example: 在此组件中,我需要带有其内置函数
JRoute
Joomla重定向,例如:
JRoute::_('index.php?option=com_customcomponent&view=registration');
I have a menu item, which is linked to the URL above and has an alias with the name registration . 我有一个菜单项,该菜单项链接到上面的URL,并且具有名称为registration的别名。 Furthermore I set a special template for this view.
此外,我为此视图设置了特殊的模板。 If I call the link http://www.mywebsite.com/registration => the view will be opened with the right design (special template).
如果我调用链接http://www.mywebsite.com/registration =>,将以正确的设计(特殊模板)打开视图。
If I access it on a direct way http://www.mywebsite.com/index.php?option=com_customcomponent&view=registration or inside my component with JRoute
, the view will be shown with the wrong template (it will be show with the Standard Template and not the special template). 如果我直接通过http://www.mywebsite.com/index.php?option=com_customcomponent&view=registration或使用
JRoute
在我的组件内部访问它,则该视图将显示有错误的模板(将与标准模板而不是特殊模板)。
What could be wrong here? 这有什么问题吗?
It is necessary to put the Menu Item in the link. 有必要将菜单项放在链接中。
JRoute::_('index.php?option=com_customcomponent&view=registration&Itemid=xx') JRoute :: _('index.php?option = com_customcomponent&view = registration&Itemid = xx')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.