3

Hello Joomla community,

I'd like to create a category blog layout where all articles are shown with their entire content. I.e. without having the article shortened at the 'read more' position. What's the easiest way to accomplish this?

Any advice is welcome, Thank you.

5 Answers 5

10

About Joomla Intro & Full Article Text

Well, here is how this works:

When creating an article, you have the option to insert a "Read More" in your article.

What happens when you insert the Read More is that it splits the content of the article into 2 pieces, and it saves these 2 pieces in 2 database columns in the db #__content table.

The text before the Read More goes into the introtext and the text after the Read More goes into the fulltext column.

If you don't use the Read More, then the whole text goes into the introtext.

Later the blog category layout always renders the introtext of the article.

The simple way to show full text in blog layout:

So, the easiest way to have a category blog layout showing the full text, is to not insert the Read More into your articles.

Now if you feel a bit more adventurous, you can customize the blog category layout to suit your needs.


Alternative Layouts

I would suggest to create an Alternative Menu Item for the Blog Category Layout, as it will allow you create menu items for any category and still be able to have different layouts for them.

And here is how to do it:

1. Create the required files for the alternative layout:

Inside :

components/com_content/views/category/tmpl

Clone (duplicate) the files listed below and rename the cloned files :

  • blog.php duplicate and rename to-> blogfull.php
  • blog.xml -> blogfull.xml
  • blog_children.php -> blogfull_children.php
  • blog_item.php -> blogfull_item.php
  • blog_links.php -> blogfull_links.php

2. Edit the new xml file
Open the blogfull.xml and edit the top lines:

<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">
        <help key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_BLOG" />
        <message>
            <![CDATA[COM_CONTENT_CATEGORY_VIEW_BLOG_DESC]]>

to something like:

<layout title="Blog Full Text" option="Blog Category Layout with Full Text">
        <help key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_BLOG" />
        <message>
            <![CDATA[Blog Category Layout with Full Text]]>

3. Edit the new template file of the blog item.
Open the and edit line around 47:

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

Change to:

<?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->introtext; echo $this->item->fulltext; ?>

4. Create Menu Items with your new Alternative Menu Item

Now you will have a new menu item to choose for your category blog layouts. Go in Menu Manager and create a new menu item for the articles component. When you are about to choose they menu item type, you will find a new type: Blog Full Text. *Make sure you will adjust any settings/options of the menu item to suit the rest of your needs (show/hide readmore etc).

Documentation: Alternative Menu Items

8
  • Thank you very much for explaining in such detail! That's very valuable. It leads me to the conclusion that the easiest way to workaround it is to simply create the article twice - with and without read more. Makes me wonder why I haven't had that idea earlier... Commented Jun 11, 2015 at 9:33
  • Why you want to create the article twice?
    – FFrewin
    Commented Jun 11, 2015 at 9:34
  • In general, the visitors of the site should see the shortened article with the read more button. For journalists however, I'd like to have one page containing all the information there is. Journalists tend to be very busy, and I'd like to avoid forcing them to click through my website to find the relevant information. Commented Jun 11, 2015 at 10:27
  • And how will you distinguish who is who (journalists from other users), so you will show different content?
    – FFrewin
    Commented Jun 11, 2015 at 10:31
  • The journalists get a link to the blog layout that displays the articles in full together with the press release. This blog layout uses a hidden menu (to create the url) and it's even excluded from indexing through robots.txt, because the page will be removed from the site once the media work is done. So it's meant to be accessed directly by only those people who know about it. I got it working already, thou I really like @pippo8765 solution. Commented Jun 11, 2015 at 10:40
2

I'd say none of the above completely solves the general situation when you have article where you want to have a "Read more..." link / button. So, hiding "Read more" (within menu item parameters or article settings) will do exactly as it says - it'll simply hide "read more" and the whole article won't show up again at the end.

What you need to do in this case is create an override for category blog view.

Go to Extensions - Template Manager - Templates (on the left) - click on your default site template title. Now you're editing your template more "close" to its php code. No matter, you might not know PHP, you can do it here.

Choose the "Create Overrides" tab at the top. In list(s) click on com_content (middle column) -> category. Joomla created all folders and files you need to change now. You only need to change a few lines for your particular problem. Go to "Editor" tab now -> click html folder, then com_content -> category. The file you need is blog_item.php. Click on it and you'll see it on the right. Now you need to edit the line around 47 in my version of Joomla (3.4.1) which is:

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

Change to

<?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->introtext.$this->item->fulltext; ?>

Now click Save & Close. Refresh your page where you have category blog view and you'll get full text of your article(s). This will work if you have "Show Intro Text" parameter set to Show within Menu item Options parameters and I presume you want to keep this. By default it's Show in global configuration. Also, you can set "Show read more" to "Hide" now within same menu item since you don't really need it now.

This way you'll keep "Read more" link for all other instances of your article(s) except for the blog category view.

2
  • Wow, awesome! That's a great solution! How do I have to modify the code to have the effect only for menu items with the id 6, 7, 8? My intention is to have two menu items, a public one that displays the blog layout for the general public (this view should display the read more button as it is), and a second, hidden menu item that displays the whole articles in one page. (This one's intended only for people who know the direct link.) Commented Jun 11, 2015 at 10:15
  • @SePröbläm the easiest way is to create an override like FFrewin said. That is because your menu items may change in the future.
    – Eoin
    Commented Jan 3, 2018 at 17:17
1

As with all things Joomla there are several methods:

Basic

The simplest way is not to have the 'read more' buttons in your Articles.

Through the Menu Item

If you need to use them for other layouts/reasons, then you can configure the Menu Item you are using for displaying this particular page to ignore 'Read More'

Go to the 'Options' tab and set 'Show Read More' to 'Hide'.

Set it globally

There is another global method of doing this too, go to the Article Manager and click on the 'Options' button on the top-right corner of the page.

In the 'Article' tab, set the 'Show Read More' to 'Hide'.

1
  • 2
    Method 2 & 3 do not apply on what the OP asks. Setting the 'Show Read More' to 'Hide' will only hide the 'Read More' link after the introtext.
    – FFrewin
    Commented Jun 11, 2015 at 9:17
1

In regards to the original question. Showing the full article without the introtext.
A very simple way which requires no coding experience.
In the category, under the 4th dropdown "Item view options in category listings" There is the option to choose the Introtext word limit. If you leave this field blank, it will by default, show all of the article text.

Simple, done and nothing has to get customized!

0

If it's for a smaller website you can just create the menu-item for a blogview in the tab 'Blog Layout' and put for the number of 'leading articles' a big number like 999999. It'll show the first 999999 articles in that category as full text (but also full width/1 column, so you can't use the multiple column setting there cause that is for the intro articles).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.