如何在joomla中创建文章的链接? [英] How to create a link to an article in joomla?

查看:682
本文介绍了如何在joomla中创建文章的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站包含一些图标,我希望每个图标指向文章的链接,我已经创建了这些文章,我想在不创建菜单项的情况下显示它们。
我试图这样做:

图标1的Href - >第1条

图标2的Href - >第2条

.. 。
但我的目标页面只显示文章的文字,没有网站的滑块和主菜单。

对我有用的东西:

我创建了一个名为hidden with menu menu的菜单,我将每个菜单项与我想要的文章相匹配,然后我在href的图标中添加了文章的链接。


菜单项1 - >隐藏/ item1和我选择了第1条

菜单项2 - > hidden / item2我选择了第2条。


My website contains some icons, I want that each icon point to a link to an article, I have already create those articles, I want to show them without creating menu items. I tried to do that :
Href of icon1 -> Article 1
Href of icon2 -> Article 2
... But my target page show only the text of the article, without the slider and the main menu of the website.
What works for me :
I have created a menu called hidden with menu items, I matched each menu item with the article that I want, then I added the link of the article in my href's icon.
Menu item 1 -> hidden/item1 and I selected Article 1
Menu item 2 -> hidden/item2 and I selected Article 2.

谢谢。

推荐答案

如果你想要保留所需的模块,需要指定一个菜单项。这是因为您希望控制哪些模块应显示哪些文章,因为模块是由菜单项指定的。如果没有按用途指定的菜单项,则会显示错误的模块或根本没有模块。

If you want to keep the desired modules, you need to specify a menu item. This is because you want to have control over what modules should be displayed with what articles, as modules are assigned by menu items. If there is no menu-item specified by purpose, then the wrong modules will be displayed or no modules at all.

因此,实现此目的的最佳方法是创建一个单独的菜单和每篇文章的相应菜单项。您可以将此菜单命名为隐藏,因为您不希望创建模块并在前端显示它。然后,您可以将图标链接到每个文章,包括网址中的菜单项ID:
网址示例:

So, best way to achieve this is to create a separate menu and the respective menu items for each of your articles. You can name this menu as "Hidden", since you will not want to create a module and display it at the front-end. Then you can link your icons to each article including the menu item id in the url: Example of the url:

index.php?option=com_content&view=article&id=1&Itemid=100

如果你的图标在自定义html模块中,然后我建议使用JCE编辑器的链接管理器链接到你的菜单项/文章。

If your icons are inside a custom html module, then I would suggest to use the link manager of the JCE editor to link to your menu items/articles.

如果你正在链接从您的模板内部,然后您可能想要使用JRoute()来创建链接,以确保如果您启用它们的SEF网址...

If you are linking from inside your template, then you might want to use the JRoute() to create the link, to ensure SEF urls if you enable them...

所以代码为链接看起来像:

So the code for the link would look like:

<a href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=1&Itemid=100'); ?>">Link</a>

这篇关于如何在joomla中创建文章的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆