php - Make read more link open on separate page in joomla

361

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

39

Answer

Solution:

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...

426

Answer

Solution:

I'm assuming you are talking about thetarget 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>

145

Answer

Solution:

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>';

People are also looking for solutions to the problem: Long pulling PHP & AJAX - Server Performance

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.