The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Fri Apr 13, 2012 3:35 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 16, 2008 8:32 pm
Posts: 26
Hi all,

Is there any way to have an article to open in a new page, rather than in the main body area?

I am using the "Latest News" module on my home page. In module settings, I have set "Menu Assignment" to only Home page. I want the Latest News module/box to show only on the home page and when someone clicks on any of the Latest News headlines, I want them to read the article in a new page, rather than on the same page.

Looks like, the article loads in the "Main Body" area of the home page because the "Latest News" box still shows at the bottom of the article content and the "Home" menu item shows it is still an active/current page.

Is there any way around this?

I am working on a custom Joomla template and I am using 2.5.4.

Any help would be appreciated.

Thanks,
Marz


Last edited by faramarz58 on Tue Apr 17, 2012 3:56 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Apr 13, 2012 4:03 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 13, 2008 2:57 am
Posts: 20420
Location: Chennai, India
You could edit the following line of code that is present in the file default.php that is located in the directory \modules\mod_articles_latest\tmpl, as follows:

Before Edit:
Code:
      <a href="<?php echo $item->link; ?>">

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


Being a core Joomla! file, suggest using the output override technique as documented at http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core.

_________________
- Ilagnayeru (MIG) Manickam
http://www.eegan.org - helping the poor and underprivileged
educate. empower. enrich.
Support the poor and underprivileged


Top
 Profile  
 
PostPosted: Fri Apr 13, 2012 5:33 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 16, 2008 8:32 pm
Posts: 26
Hi iman,

Thanks for your reply, but by new page I didn't mean open the article in a "New Window" by adding "_blank" attribute to the URL.

I want to show the headline of my latest articles on the home page, after they click on any headline I want them to read the article/news but I don't want the headline of the articles to show under the article content area.

Looks like Joomla loads the content of the articles in the "Main Body" component area of the home page. That's why the Latest news headlines are still showing at the bottom of article content.

I can send you a link to my website with a u/p in a private message to explain the situation.

Thanks


Top
 Profile  
 
PostPosted: Fri Apr 13, 2012 10:31 pm 
Joomla! Master
Joomla! Master

Joined: Mon Oct 27, 2008 9:27 pm
Posts: 13758
Location: Akershus, Norway
Add &tmpl=component to the url and it will show only the component without the template.

If there is a component.php file in your template, it will control the look. It takes the same jdoc statements as the index.php file. Of course you can use any file name other than component.

http://docs.joomla.org/Jdoc


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 1:28 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 16, 2008 8:32 pm
Posts: 26
Thanks Per Yngve,

I added &tmpl=component to the url. I edited this line in mod_articles_latest>tmpl>default.php

from:
Code:
<a href="<?php echo $item->link; ?>" class="announcements<?php echo $params->get('moduleclass_sfx'); ?>">

to:
Code:
<a href="<?php echo $item->link; ?>&tmpl=component" class="announcements<?php echo $params->get('moduleclass_sfx'); ?>">

and I got page not found after clicking on the headlines on the home page. My urls changed from:
Code:
http://mydomain.com/80-announcements/72-announcement-test-2.html

to:
Code:
http://mydomain.com/80-announcements/72-announcement-test-2.html&tmpl=component

I think I made a mistake somewhere, or maybe what you meant was not adding the &tmpl=component to this line in this page.

I do have a component.php file in my template. I looked at the documentation but didn't figure out what to add to my code in index.php

This is what I have in my index.php for the latest news module:

Code:
<?php if ($this->countModules('Announcements')): ?>
<div id="announcements">
<jdoc:include type="modules" name="Announcements" title="Announcements" />
</div>
<?php endif; ?>

I have attached two screenshots. The first one shows the location of the latest news modules items on the home page. The second one shows the detail page when you click on any of the headlines. As you see in the second screenshot, the title of the articles still show at the bottom of the article blurb, that's what I am trying to get rid of.

Thanks for your help.

Marz


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 2:56 pm 
Joomla! Master
Joomla! Master

Joined: Mon Oct 27, 2008 9:27 pm
Posts: 13758
Location: Akershus, Norway
A "?" is missing in the url. It divide the first parameter from the url. Following parameters are divided by a "&".

So you have to replace the "&" with "?" since it's the first parameter.


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 3:15 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 16, 2008 8:32 pm
Posts: 26
yes, the "?" did the trick. Problem is, this solution strips out the whole template and that's not what I am planning to do.

All I want is, not to show the headlines of the latest news items on the detail page. One of the screenshots (detail page) shows where the headlines at the bottom are showing, that's what I am trying to get rid of.

Is there any other plugin/solution for doing this other than tweaking the "Latest News" module?

Thanks,
Marz


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 3:26 pm 
Joomla! Master
Joomla! Master

Joined: Mon Oct 27, 2008 9:27 pm
Posts: 13758
Location: Akershus, Norway
Oh, you want to have some module positions. The core component.php only have the head and the component area. Create another file i.e mini.php in your template and make a template with the information you want to show.


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 3:53 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 16, 2008 8:32 pm
Posts: 26
got it!.. I saved "index.php" as "latest.php".. got rid of the module position in "latest.php" that was generating the latest news headlines, then added ?tmpl=latest to the URL and that fixed it.

Now the headlines are not showing on the detail page, I can also add a "Back" button at the bottom of the blurbs in case they want to hit back to the home page.

Thank you so so much for all your help :)

Marz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 



Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group