List articles full text
Moderator: General Support Moderators
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.
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.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 04, 2009 2:29 am
List articles full text
Hi people of the forum.
I am having problems in displaying a Blog Category but I do not want to display de Intro text just the main text. Does anyone have an idea of how to do this?
Thanks,
I am having problems in displaying a Blog Category but I do not want to display de Intro text just the main text. Does anyone have an idea of how to do this?
Thanks,
- ranwilli
- Joomla! Master
- Posts: 19203
- Joined: Sun Feb 19, 2006 6:47 pm
- Location: Toledo, OH
- Contact:
Re: List articles full text
Menu Item Parameters on the right side, make them all leading articles, 0 intro, 1 column, as many links as you like.
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com
Stay ON the update path.
https://harpervance.com
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 04, 2009 2:29 am
Re: List articles full text
Thanks for your answer but in that way all the articles are leading articles, but still they show the Intro text each one, what I need is for them to show the main text.
- ranwilli
- Joomla! Master
- Posts: 19203
- Joined: Sun Feb 19, 2006 6:47 pm
- Location: Toledo, OH
- Contact:
Re: List articles full text
Set the parameters to "Hide Intro"
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com
Stay ON the update path.
https://harpervance.com
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 04, 2009 2:29 am
Re: List articles full text
Yes in the article I set the Hide for the introduction but the Blog Category still shows the introduction text even I set the introduction articles to 0, and all are main articles.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Mon May 04, 2009 5:51 pm
Re: List articles full text
I'm having the same problem. On one "Section Blog" I want only intro text to appear and have a "Read more..." link to see the rest of the article. That was easy! On a separate menu link to a "Category Blog" I want to display the same article, but the full text, not just intro text. Basically I inserted a read more rule in the article text in my WYSIWYG editor, but I want a specific "Category Blog" to ignore the read more rule. Any ideas??? Right now I have all articles for the "Category Blog" set as leading as opposed to intro, but it doesn't seem to make a difference.
Please help!
Please help!
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu Nov 26, 2009 2:49 pm
Re: List articles full text
Hey there,
I'm having the exact problem. I want to have a category blog layout page displaying articles in full text while having a newsflash module displaying random articles from the same category only with intro text. Can't seem to be able to do that even if I set "For each feed item show" to "Full text".
Please advice!
I'm having the exact problem. I want to have a category blog layout page displaying articles in full text while having a newsflash module displaying random articles from the same category only with intro text. Can't seem to be able to do that even if I set "For each feed item show" to "Full text".
Please advice!
-
- Joomla! Enthusiast
- Posts: 160
- Joined: Thu Dec 31, 2009 12:04 am
Re: List articles full text
Same for me. Is anyone able to show how to display the FULL text for a Category Blog (or List) Layout?
Thanks
Geoff
Thanks
Geoff
- andpatton
- Joomla! Apprentice
- Posts: 23
- Joined: Fri May 29, 2009 3:50 pm
- Contact:
Re: List articles full text
While Joomla, in its default setup, does not display full articles on section or category blog pages when the article contains a readmore, even if it's a "leading" article (in the blog layout, a "leading" article seems roughly equivalent to an "intro" article in practical terms), this functionality is fairly easy to accomplish with a template output override (if you don't know what that means, I highly recommend reading Andrew Eddie's excellent tutorial about them). I will outline the necessary changes here to make the category blog output include the full text of an article (and not display the read more link) if it is a leading article:
First, we will need to setup our override in the site's template (or templates). In the template that your section/category blog page will be using, create the folder /html if it doesn't already exist (so it will be templates/[your-template]/html), and a folder called com_content inside html (again, if it doesn't already exist). Then we create a folder that corresponds to the type of menu item we want to modify ('category' or 'section'), and we copy over the relevant output templates from components/com_content/views/category[or section]/tmpl/ -- the two template files we will modify are blog.php and blog_item.php, so copy them over to your template in the folder we just created.
Next, we'll modify the blog.php file in order to set a variable to mark when an article should be displayed with its full text (that variable will then be checked in blog_item.php). Find the first instance of this line (around line 32): and immediately following that, add these lines:
If you are using an already modified override for this file and you're not sure where to add the above line, look for this php if block: which is where the leading articles get loaded, and then add the above code immediately before a line that looks like this:
Lastly, we'll modify the blog_item.php file to check for that variable and act accordingly (that file is used both to load 'leading' articles and 'intro' articles, hence why we need a special flag to indicate that we are dealing with a leading article). First, we need to add code to check if leading is true, and if so, load the full text instead of just the intro. The relevant code needs to replace this line (which is what displays the article text):
Here's what it should be replaced with:
Now, you probably don't want to display the "Read more" link if we've already displayed the fulltext (or perhaps you do, in which case, don't make this next change). Find this line and replace it with this line:
That's all. I've attached copies of the modified files from the default section and category blog templates (in Joomla 1.5.15), so if you don't have any template output overrides in place yet, you can just copy the files straight to their relevant locations.
Note: I just noticed that this topic is filed in Joomla! 1.0 >> Administration - 1.0.x. However, the solution I provided is not for Joomla 1.0 and will not work with anything other than J! 1.5
First, we will need to setup our override in the site's template (or templates). In the template that your section/category blog page will be using, create the folder /html if it doesn't already exist (so it will be templates/[your-template]/html), and a folder called com_content inside html (again, if it doesn't already exist). Then we create a folder that corresponds to the type of menu item we want to modify ('category' or 'section'), and we copy over the relevant output templates from components/com_content/views/category[or section]/tmpl/ -- the two template files we will modify are blog.php and blog_item.php, so copy them over to your template in the folder we just created.
Next, we'll modify the blog.php file in order to set a variable to mark when an article should be displayed with its full text (that variable will then be checked in blog_item.php). Find the first instance of this line (around line 32):
Code: Select all
$this->item =& $this->getItem($i, $this->params);
Code: Select all
// Tell item template it's a leading article:
$this->item->leading = true;
Code: Select all
<?php if ($this->params->get('num_leading_articles')) : ?>
Code: Select all
echo $this->loadTemplate('item');
Code: Select all
echo $this->item->text;
Code: Select all
// Check if leading has been set and is true:
$leading = (isset($this->item->leading) && $this->item->leading);
if ($leading && $this->item->fulltext) { // If leading and there is fulltext defined
// Then we will display the full article, not just introtext
if ($this->item->params->get('show_intro')) {
echo $this->item->introtext;
}
echo $this->item->fulltext;
}
else {
echo $this->item->text;
}
Code: Select all
<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
Code: Select all
<?php if ($this->item->params->get('show_readmore') && $this->item->readmore && !$leading) : // also if not leading ?>
Note: I just noticed that this topic is filed in Joomla! 1.0 >> Administration - 1.0.x. However, the solution I provided is not for Joomla 1.0 and will not work with anything other than J! 1.5
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Fledgling
- Posts: 4
- Joined: Mon Mar 21, 2011 3:34 pm
Re: List articles full text
thanks, the solution is not 100% correct anymore, but it works just fine, perfect!
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue Sep 06, 2011 5:08 pm
Re: List articles full text
I had have the same problem on http://www.tus07.de/joomla/senioren/dri ... richt.html
I solved it, but now the images can't be clicked and viewed with the lightbox as at http://www.tus07.de/joomla/senioren/dri ... gen-1.html
Hope you can help me.
I solved it, but now the images can't be clicked and viewed with the lightbox as at http://www.tus07.de/joomla/senioren/dri ... gen-1.html
Hope you can help me.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sat Jan 14, 2012 4:33 pm
Re: List articles full text
Thank you so much...! That solved my problem...! You are GREAT... I used this method on FJ Related Component and it's working...
If you are using FJ Related Component just skip this part:
Just copy over your files in /components/com_fjrelated/views/fjrelated
If you are using FJ Related Component just skip this part:
Here are files for FJ Related if someone want it...andpatton wrote:If you are using an already modified override for this file and you're not sure where to add the above line, look for this php if block:which is where the leading articles get loaded, and then add the above code immediately before a line that looks like this:Code: Select all
<?php if ($this->params->get('num_leading_articles')) : ?>
Code: Select all
echo $this->loadTemplate('item');
Just copy over your files in /components/com_fjrelated/views/fjrelated
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Dec 13, 2012 12:10 am
Re: List articles full text
Well, I tried using the code posted above and with a bit of tweaking I managed to make it work. I needed to make three changes to the following files (in Joomla 2.5.8 ):
/components/com_content/models/articles.php (to add the fulltext field to the SQL query):
/components/com_content/views/category/tmpl/blog.php (to mark the item as a Leading article):
/components/com_content/views/category/tmpl/blogitem.php (to fix the display when the item has been marked as a Leading article):
Then you just need to set your menu to use Category Blog and set the Blog Layout options to show as many leading articles as you want.
As stated in previous posts above, you can use template overrides to put the modified blog.php and blogitem.php template files into the appropriate template directory, but you can't do this with the article.php model file (or at least it didn't work when I tried it).
I have looked briefly at the Plugin Override extension (which can be downloaded from here) but I haven't yet worked out how to use this to avoid changing the core for article.php (so if anyone can help here that would be great).
It would also be great if Content Options / Blog Layout options gave you a dropdown to select whether you wanted this by default or for a specific menu item - if this could be added in the core of 3.5 that would be great.
P
/components/com_content/models/articles.php (to add the fulltext field to the SQL query):
Code: Select all
Replace all instances of:
a.introtext,
with
a.introtext, a.fulltext,
Code: Select all
Look for:
<div class="items-leading">
and a few lines later immediately BEFORE the line:
echo $this->loadTemplate('item');
add the following lines:
// Tell item template it's a leading article:
$this->item->leading = true;
Code: Select all
Look for:
<?php echo $this->item->introtext; ?>
and replace this line with the following lines:
<?php
// Show full text for leading articles.
// echo $this->item->introtext;
// Check if leading has been set and is true:
$leading = (isset($this->item->leading) && $this->item->leading);
if ($leading && $this->item->readmore) { // If leading and there is fulltext defined
// Then we will display the full article, not just introtext
if ($params->get('show_intro')) {
echo $this->item->introtext;
}
echo $this->item->fulltext;
}
else {
echo $this->item->introtext;
}
?>
As stated in previous posts above, you can use template overrides to put the modified blog.php and blogitem.php template files into the appropriate template directory, but you can't do this with the article.php model file (or at least it didn't work when I tried it).
I have looked briefly at the Plugin Override extension (which can be downloaded from here) but I haven't yet worked out how to use this to avoid changing the core for article.php (so if anyone can help here that would be great).
It would also be great if Content Options / Blog Layout options gave you a dropdown to select whether you wanted this by default or for a specific menu item - if this could be added in the core of 3.5 that would be great.
P
-
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Mar 30, 2011 3:28 pm
Re: List articles full text
@up
As you said, it's not the proper way to do it, because you're modifying joomla core file, which can be overridden during joomla update. The solution is really simple - just use this code in your view file:
As you said, it's not the proper way to do it, because you're modifying joomla core file, which can be overridden during joomla update. The solution is really simple - just use this code in your view file:
Code: Select all
<?php foreach ($this->lead_items as &$item) : ?>
...
$this->item = &$item;
/*** Here are 3 added lines ***/
$article =& JTable::getInstance('content');
$article->load($this->item->id);
$this->item->fulltext = $article->fulltext;
/*** End of added lines ***/
echo $this->loadTemplate('item');
...
<?php endforeach; ?>
- ranwilli
- Joomla! Master
- Posts: 19203
- Joined: Sun Feb 19, 2006 6:47 pm
- Location: Toledo, OH
- Contact:
Re: List articles full text
Please note the category (and age) of these posts...Nashi wrote:@up
As you said, it's not the proper way to do it, because you're modifying joomla core file, which can be overridden during joomla update. The solution is really simple - just use this code in your view file:
Code: Select all
<?php foreach ($this->lead_items as &$item) : ?> ... $this->item = &$item; /*** Here are 3 added lines ***/ $article =& JTable::getInstance('content'); $article->load($this->item->id); $this->item->fulltext = $article->fulltext; /*** End of added lines ***/ echo $this->loadTemplate('item'); ... <?php endforeach; ?>
There were no template overrides in Joomla 1.0
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com
Stay ON the update path.
https://harpervance.com
-
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Mar 30, 2011 3:28 pm
Re: List articles full text
@ranwilli,
read carefully
this:
read carefully
this:
and:Protopia wrote:Well, I tried using the code posted above and with a bit of tweaking I managed to make it work. I needed to make three changes to the following files (in Joomla 2.5.8 ):
I noticed date of the last post - 4 months ago is not that long Anyway, I think my solution can help if anyone else (like me) will find this topic through google.Protopia wrote:I have looked briefly at the Plugin Override extension (which can be downloaded from here) but I haven't yet worked out how to use this to avoid changing the core for article.php (so if anyone can help here that would be great).
- Per Yngve Berg
- Joomla! Master
- Posts: 30771
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: List articles full text
Nashi: This is the Joomla 1.0 forum. You have to start a new topic in the J2.5 forum and discuss it there.