繁体   English   中英

使更多链接在joomla的单独页面上打开

[英]Make read more link open on separate page in joomla

我正在使用joomla 2.5。 创建文章时,我会添加更多阅读文章的链接。 我遇到的问题是,当页面上只有一篇文章时,“阅读更多”链接会用新文章覆盖该内容。 我希望阅读更多链接作为单独的页面打开。 我希望它是动态的,而不是手动更改。

我有什么想念的吗? 任何帮助表示赞赏。 谢谢

我不确定您是否对它进行了整理,但我想我知道您的意思。

您可能需要创建一个新菜单并将其用作隐藏菜单

因此,要在单独的页面或自己的页面中打开文章,请创建一个隐藏菜单。

1-转到菜单2-单击菜单项旁边的菜单选项卡3-单击新菜单4-给它提供标题示例隐藏菜单5-填写菜单类型示例隐藏6-说明可选

在您创建的这个新菜单中,您想创建一个菜单项

取决于您文章的存储位置,取决于您的菜单项

假设您的文章属于新闻类别

制作一个新的菜单项,将其命名为您想要的

然后在菜单项类型中选择Category Blog,然后在Required Settings中选择您的类别...

保存菜单项...

那应该做你想要的...

因此,当您单击主菜单时,在主菜单中有一篇属于新闻类别的文章。 文章应单独在同一窗口中打开...

请原谅发现任何拼写错误...

我假设您是在谈论target属性,如果需要,这是您需要查看的地方

Value   Description
_blank  Opens the linked document in a new window or tab
_self   Opens the linked document in the same frame as it was clicked (this is default)
_parent Opens the linked document in the parent frame
_top    Opens the linked document in the full body of the window
framename   Opens the linked document in a named frame

例如, <a href="http://example.com" target="_self" >Open link in the same frame</a>

而对于您正在寻找的是

<a href="http://example.com" target="_blank" >Read More</a>

我经历了Newsflash模块选项和源代码,不幸的是,该模块将始终在同一窗口中打开链接。

您将需要覆盖布局以修改此行为。

http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

这是您需要“克隆”到模板文件夹中的文件,如上面的链接所述:

modules / mod_articles_news / tmpl / _item.php

最后,在新文件中,将第16行修改为:

<a href="<?php echo $item->link;?>" target="_blank">

然后是第34行

echo '<a class="readmore" href="'.$item->link.'" target="_blank">'.$item->linkText.'</a>';

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM