Page 1 of 1

Category Blog as Full Text

Posted: Tue Jul 12, 2011 9:35 am
by kiteplans
No Way to Display Category Blog as Full Text

blog_item.php changed in the following way.

Code: Select all

<?php echo $this->item->introtext; ?>
to

Code: Select all

<?php echo $this->item->text; ?>
or adding

Code: Select all

<?php echo $this->item->fulltext; ?>
Should allow me to display only or full text in the category blog view. As it did in the past in 1.5.

Doing a var_dump .. I see that the full content of the story does not seem to be present at all, just the introtext!?

Joomla Version 1.7.0

Re: Category Blog as Full Text

Posted: Wed Jul 13, 2011 2:28 am
by kiteplans
Is anyone looking at these bug reports?

Re: Category Blog as Full Text - ADDITIONS TO CODE

Posted: Wed Jul 13, 2011 3:03 am
by kiteplans
I have also gone ahead and fixed a function to make the intro hide and show on the blog view work.

blog_item.php line 56 -58 in my case

Code: Select all

<?php if (!$params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php endif; ?>
Changed to (Notice the
!
removed before the $params to fix this - I have also removed this in templates/[template name]/html/com_content/article/default.php)

Code: Select all

<?php if ($params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php endif; ?>
Then add
<?php echo $this->item->introtext; ?>

Code: Select all

<?php if ($params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php echo $this->item->introtext; ?>
   <?php endif; ?>
Now you can hide the intro text if wanted or show it along.



Now lets get the full text to display

in file - com_content/models/articles.php

Line 162 in my case, find

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext,'
Simply add a
a.fulltext,
behind that like so...

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext,'

Logically – if you have read more shown you wont need full text.

Now open your template override file for category blogs
templates/[template name]/html/com_content/category/blog_item.php
So lets make it work in the following way – if read more is shown, fulltext is not, if read more is hidden fulltext is shown

find and remove

Code: Select all

<?php echo $this->item->introtext; ?> 

Then find /b]

Code: Select all

<?php endif; ?>

<?php if ($this->item->state == 0) : ?>
Add before the
<?php endif; ?>
:

Code: Select all

<?php else : ?>
	<?php echo $this->item->fulltext; ?>
like so

Code: Select all

	<?php else : ?>
	<?php echo $this->item->fulltext; ?>
<?php endif; ?>

<?php if ($this->item->state == 0) : ?>
This will show the full text when read more is hidden, and only the read more link when it is is shown


If you want to always display the Full text do it as follow:

Now open your template override file for category blogs
templates/[template name]/html/com_content/category/blog_item.php
Find

Code: Select all

<?php echo $this->item->introtext; ?> on line 131 in my case
and change the introtext; to fulltext;

Code: Select all

<?php echo $this->item->fulltext; ?>

Re: Category Blog as Full Text

Posted: Wed Nov 23, 2011 9:43 am
by flatpat
Thank you very much for this. The extended DB query solves my problem with the fulltext not being available.

Re: Category Blog as Full Text

Posted: Wed Nov 23, 2011 2:11 pm
by kiteplans
Cool glad it helped you!

Re: Category Blog as Full Text

Posted: Thu Jan 19, 2012 1:38 pm
by BrettVorster
Yo Kiteplans - You're a legend! Thank you for the solution. You really helped me out!

Re: Category Blog as Full Text

Posted: Fri Jan 20, 2012 1:20 am
by kiteplans
No problem - I have worked on this a bit more and will post some more info when I get some time!

Re: Category Blog as Full Text - ADDITIONS TO CODE

Posted: Sun Jan 29, 2012 12:37 pm
by toddb575
kiteplans wrote:I have also gone ahead and fixed a function to make the intro hide and show on the blog view work.

blog_item.php line 56 -58 in my case

Code: Select all

<?php if (!$params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php endif; ?>
Changed to (Notice the
!
removed before the $params to fix this - I have also removed this in templates/[template name]/html/com_content/article/default.php)

Code: Select all

<?php if ($params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php endif; ?>
Then add
<?php echo $this->item->introtext; ?>

Code: Select all

<?php if ($params->get('show_intro')) : ?>
   <?php echo $this->item->event->afterDisplayTitle; ?>
   <?php echo $this->item->introtext; ?>
   <?php endif; ?>
Now you can hide the intro text if wanted or show it along.



Now lets get the full text to display

in file - com_content/models/articles.php

Line 162 in my case, find

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext,'
Simply add a
a.fulltext,
behind that like so...

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext,'

Logically – if you have read more shown you wont need full text.

Now open your template override file for category blogs
templates/[template name]/html/com_content/category/blog_item.php
So lets make it work in the following way – if read more is shown, fulltext is not, if read more is hidden fulltext is shown

find and remove

Code: Select all

<?php echo $this->item->introtext; ?> 

Then find /b]

Code: Select all

<?php endif; ?>

<?php if ($this->item->state == 0) : ?>
Add before the
<?php endif; ?>
:

Code: Select all

<?php else : ?>
	<?php echo $this->item->fulltext; ?>
like so

Code: Select all

	<?php else : ?>
	<?php echo $this->item->fulltext; ?>
<?php endif; ?>

<?php if ($this->item->state == 0) : ?>
This will show the full text when read more is hidden, and only the read more link when it is is shown


If you want to always display the Full text do it as follow:

Now open your template override file for category blogs
templates/[template name]/html/com_content/category/blog_item.php
Find

Code: Select all

<?php echo $this->item->introtext; ?> on line 131 in my case
and change the introtext; to fulltext;

Code: Select all

<?php echo $this->item->fulltext; ?>

Hii, kiteplans,

Thank you Very much...! I'm having the same problem.That's OK Now,That solved my problem...! You are Simply GREAT !

Re: Category Blog as Full Text

Posted: Tue Feb 07, 2012 1:02 pm
by BrettVorster
I do have one slight issue with this tho. I just upgraded to 2.5.1 and with the upgrade pack it overwrote the articles.php file in Models (com_components) so when I looked at my site > portfolio page: http://www.bgv.co.za/portfolio.html there was space where the content should have been. I just needed to fix the model/articles.php file... I tried copying the models folder to my overides > template/html/com_content but it didnt work only when I overwrote the main one did it work... maybe yall know where I went wrong?

Re: Category Blog as Full Text

Posted: Wed Feb 08, 2012 1:11 am
by kiteplans
I have not been able to find a way to overwrite this as well.

After upgrade I check:

in file - com_content/models/articles.php

Line 162 in my case, find

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext,'
Simply add a

Code: Select all

a.fulltext,
behind that like so...

Code: Select all

'a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext,'
Check also:

components\com_content\views\article\view.html.php

line 113:

Code: Select all

		if ($item->params->get('show_intro','1')=='1') {
			$item->text = $item->fulltext;

Re: Category Blog as Full Text

Posted: Thu Feb 09, 2012 4:53 pm
by SwingShoes
Is there an expectation that Joomla 2.5 will incorporate a way to see either "intro text" or "full text" in a Category Blog format?

Currently, it has been changed from 1.5 (where it showed either using a switch on the administrator side) to now only showing a list of Subcategories.

Please let us know if this bug is being addressed so that we don't have to be altering code (as in the above fixes) for each updated version of Joomla.

Thank you,
Erik

Re: Category Blog as Full Text

Posted: Sat Mar 17, 2012 5:51 am
by monalh
Thanks for this tip! It works great, but the problem now is that I can't remove the read-more... This solution works like: read-more showing then only intro, read-more hidden then full text (introtext and text under the read-more input).

For example:
This page should show an article blog layout with only the intro-text WITHOUT the "read-more". http://www.wayosi.no/ravenews
This page shows the same articles in an article blog layout with the whole text WITHOUT the "read-more". http://www.wayosi.no/news

Any way to solve this???

Re: Category Blog as Full Text

Posted: Tue Mar 20, 2012 9:08 am
by Reuss
I really hope "show fulltext" will be an implemented option in Joomla 2.5 - I desperately need it and I'm just not any good at coding :S

Re: Category Blog as Full Text

Posted: Sun Mar 25, 2012 12:59 pm
by kiteplans
monalh - I am having some trouble understanding exactly what you want and one of the example pages does not work - could you try to explain this a bit more
monalh wrote:Thanks for this tip! It works great, but the problem now is that I can't remove the read-more... This solution works like: read-more showing then only intro, read-more hidden then full text (introtext and text under the read-more input).

For example:
This page should show an article blog layout with only the intro-text WITHOUT the "read-more". http://www.wayosi.no/ravenews
This page shows the same articles in an article blog layout with the whole text WITHOUT the "read-more". http://www.wayosi.no/news

Any way to solve this???

Re: Category Blog as Full Text

Posted: Tue Mar 27, 2012 12:34 pm
by monalh
Hi! I have found a solution, om Norwegian Forum! But I cant explain how it worked! :-))

Re: Category Blog as Full Text

Posted: Tue Mar 27, 2012 2:42 pm
by kiteplans
monalh, could you send me a link? I would like to have a look!

Re: Category Blog as Full Text

Posted: Thu Apr 12, 2012 10:23 am
by webdesco
Hi All,
for those on J1.5x there is an east solution to the problem of showing intro and full text in a blog layout, you could do a core hack, but why bother when you have overrides. create a blog item override blog_item.php
at the part where you have the if statement to check whether to show readmore

Code: Select all

<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
instead of just closing the if statement, put an elseif then check the feed summary status, if it is set to 1 then echo the item_fulltext as well.
here is the code

Code: Select all

<?php echo JFilterOutput::ampReplace($this->item->text);  ?>
<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
<p>
	<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->escape($this->item->params->get('pageclass_sfx')); ?>">
		<?php if ($this->item->readmore_register) :
			echo JText::_('Register to read more...');
		elseif ($readmore = $this->item->params->get('readmore')) :
			echo $readmore;
		else :
			echo JText::sprintf('Read more', $this->escape($this->item->title));
		endif; ?></a>
        
</p>
<?php elseif ($this->item->params->get('feed_summary') == 1): ?>
<?php echo JFilterOutput::ampReplace($this->item->fulltext);  ?>
<?php endif; ?>
Now all you need to do in Joomal administrator to get this to work is to open the menu item that you have set to display the blog layout, click on 'Parameters (Component)' scroll down and change
'Read more... Link' to 'Hide'
and the
'For each feed item show' to 'Full Text'
click save and you're done!

Re: Category Blog as Full Text

Posted: Thu Apr 19, 2012 1:26 am
by kiteplans
I have finally gotten around to writing a Template override for this - now this is no longer a Core Hack but a simple one time template override. Check out the post on my Blog and let me know what you think - http://kiteplans.info/2012/04/18/how-to ... -override/