Make read more link open on separate page in joomla

不问归期 提交于 2020-01-05 07:06:15

问题


I am using joomla 2.5. When creating an article I add read more links to it. The issue I am having is, when a page has a single article then the read more link overwrites that content with the new article. I want the read more link to open as a separate page. I want it to be dynamic and not manually change.

Any thing I am missing ? Any help is appreciated. Thanks


回答1:


I am not sure if you sorted it out but I think I know what you mean.

You may need to create a new Menu and use it as a hidden menu

so to have your articles open in a separate page or its own page create a hidden menu.

1 - Go to Menu 2 - click Menus tab next to Menu Items 3 - click new 4 - give it a Title example Hidden Menu 5 - fill out Menu type example Hidden 6 - Description optional

in this new menu you created you want to create a menu item

depending on where your articles are stored will depend on your menu item

lets say your articles are in a category named news

make a new Menu Item, call it what you want

then in menu item type select Category Blog and in the Required Settings choose your category...

save your menu item...

that should do what you want...

so in your main menu you have an article that is in the news category when you click on it. the article should open in the same window by itself...

excuse any spelling mistakes found...




回答2:


I'm assuming you are talking about the target Attributes if so this is where you need to look at

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

an example of that is <a href="http://example.com" target="_self" >Open link in the same frame</a>

and for what you are looking for is this

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




回答3:


I went through the Newsflash module options and the source code as well, unfortunately the module will always open the links on the same window.

You will need to override the layout to modify this behavior.

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

This is the file that you need to 'clone' in your template folder as explained in the link above:

modules/mod_articles_news/tmpl/_item.php

Finally, in the new file modify the line 16 to this:

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

and then the line 34

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


来源:https://stackoverflow.com/questions/9969320/make-read-more-link-open-on-separate-page-in-joomla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!