[SOLVED] Order of Articles in Category Blog Layout

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

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.
ekooy
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Jul 01, 2008 12:53 pm

[SOLVED] Order of Articles in Category Blog Layout

Post by ekooy » Wed Jul 02, 2008 9:57 pm

Hi there,

Hope you can help! :(
I have created a menu item using the CATEGORY BLOG LAYOUT. I have several Articles I would like to place under this category. How can I determine the order in which the articles will be placed in this type of layout ?
Also, in the menu item I can specify the amount of columns I would like to use. Currently this is not working (when using 3 columns, very small articles are being displayed and still underneath eachother instead of besides eachother).

Can you pleas explain how to solve this ? I can add a screenshot if required.

Thanks !
Erik :-[

User avatar
Joyce Mar
Joomla! Guru
Joomla! Guru
Posts: 893
Joined: Tue Sep 18, 2007 1:54 am
Location: Cairns, Australia

Re: Order of Articles in Category Blog Layout

Post by Joyce Mar » Wed Jul 02, 2008 11:24 pm

By default, blog layouts display in the order of "newest first". When you create the menu item to link to this blog layout, you should see a set of parameters to the right where you can choose the number of columns, leading stories, etc.

In the same section you should see something along the lines of how you want articles order, usually set to "newest first" or something similar if you haven't touched it. Here you can change it so that the order articles are displayed are the same as the Order of articles in your Article Manager. It's very useful when you want precise control of the order, but not all that useful if you want the ordering to be more dynamic over the long run.

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Thu Jul 10, 2008 3:04 pm

Thank you. This ordering issue has been driving me nuts. Didn't think to look there.

Currently the page has one article, full justified, and the rest are supposed to go in 2 columns. Like the Ekooy wrote above, I am having trouble getting the articles to behave. They ignore the 2nd column altogether and pile up one under the other. Any ideas?

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Thu Jul 10, 2008 10:18 pm

Hi. You can control the way a blog page lays out using the following Basic Parameters in the Menu Item: Add/Edit: # Leading, # Into, Columns, and # Links. These are documented in the help file here: http://help.joomla.org/index2.php?optio ... log_Layout. Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Fri Jul 11, 2008 10:03 pm

Hi,

Thanks for the reply. I've been there and settings the parameters like you've described. What gets displayed is the leading article and then two columns below it. Here's the problem; only the left column gets populated with articles. The right column is blank. Any help on this would be most appreciated.
joomlaissue.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Fri Jul 11, 2008 10:08 pm

Hi. What template are you using? It sounds like it could be a template problem. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Fri Jul 11, 2008 11:56 pm

Hi Mark,

I'm using siteground-j15-53. If that's the problem, I'm puzzled because I installed a fresh copy of Joomla! 1.5 with the sample data. Then I installed the template. It all worked just fine with 2 columns. When I trashed the sample articles and wrote my own the column issue arose.

Edit: Oh, and I just made rhuk_milkyway the default and I'm getting the same issue.

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 12, 2008 12:45 am

Interesting... In the articles you added, do you have any graphics or formatting? Did you copy from somewhere that might have put in some formatting? Maybe there is something in the content of your articles that is causing this? What if you change the columns setting to 1? Do the articles go across the whole width? I think you might have to do some detective work to try and figure this out. Like start with the sample site and add one article, see what happens, etc. Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Sat Jul 12, 2008 1:27 am

Hi Mark,

Some articles have graphics, Java and other thingies that may not play nice with natives. So I've created a new text article that included one word; "hi". No joy. Changing the columns to one displays all articles, fully 'justified', across a single column (works fine). Changing the # of leading articles to 3 did the same thing (only three articles published). Changing back to 1 lead and 2 intros with 2 column still yielded the same, undesired results.

I've made a backup of my site and am preparing to start from scratch (yuck). I had good results copying existing sample articles and re-using them. Guess I'm stuck doing that for the duration. That blows though, obviously. Creating new articles under my own categories and sections is, for me, the cornerstone of CMS yet that seems to be the very thing that creates the issue.

By the way, I'm running 1.52 in legacy mode with JCE, does that knock anything loose in the 'ol answer bin?

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 12, 2008 1:41 am

Hi. Yes, there have been a LOT of bug fixes since 1.5.2. I would first try upgrading to 1.5.4. It may not help, but it's easy to do and eliminates that as a possibility. Good luck and please post back with any new info. Thanks. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Tue Jul 15, 2008 5:37 am

I upgraded to 1.4.4 and still get the same issue. This is absolutely maddening.

Let me describe what I'm doing, step-by-step, to see if that might shed any light.
1. I've created a new section.
2. I've created a new category.
3. I created three new articles in the aforementioned Section/Category.
4. I created a new menu item in the main menu.
a. The new menu item is a Category Blog layout.
b. The new menu item parameters are set to:
# Leading: 1
# Intro: 4
# Columns: 2
# Links: 4

Any ideas?

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Tue Jul 15, 2008 3:46 pm

Hi. Unfortunately, I think you might need to do some systematic detective work. Here are two possible ideas. Start with either the Joomla! sample site or a blank stie and start modifying it (new content, new template) until you get it to break. Then you will be able to see exactly what causes it (the template, some specific content, or both). One benefit of this approach is that, if you do find a bug, it will be easy for you to provide instructions for others to reproduce it. Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"

darrenforster99
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Jul 15, 2008 11:34 pm

Re: Order of Articles in Category Blog Layout

Post by darrenforster99 » Thu Jul 17, 2008 11:55 am

I've just come across exactly the same issue of the ordering not working on my website, I too am using a SiteGround template (maybe there is a connection here). I've got it set at the moment to have no leading articles and 2 columns side by side, I've only got 2 articles so I should have them side by side, instead I'm getting them all squashed up in column 1 on the left hand side and a massive column 2 with nothing in it. If I change the parameters to 5 columns then it puts them side by side, but also squashes them (as it has another 3 empty columns to the left.). In my articles there are no graphics, just bullet points.

darrenforster99
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Jul 15, 2008 11:34 pm

Re: Order of Articles in Category Blog Layout

Post by darrenforster99 » Thu Jul 17, 2008 12:47 pm

Yes I've got a solution to what this template is doing.... and I'll do my best to explain it...

To get this template working you need to change the Intro number as well as the Columns number. The template is numbering the positions very strangely as follows:

Left Column | Right Column
------------------------------------------------|
! Position 1 | Position 3 |
| | |
|------------------------+---------------------|
| Position 2 | Position 4 |
| | |
--------------------------------------------------

So if you only have 2 items in your blog the items will both end up in the left hand column in positions 1 and 2, leaving positions 3 and 4 empty. If you change the intro number to 2 it doesn't create the bottom 2 positions. So it's filling each column up first before moving on to the next column, kind of like newspaper publishers do.

I just found out this by accident as I thought I'll add another article and see where that goes, it then pushed everything down one and moved the last article to the right I then hit on exactly what it's doing!

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Thu Jul 17, 2008 3:41 pm

Hi. The numbering you describe is the way that category and section blogs work. They number down first then across. Unfortunately, this is different than the way the front page works. I don't think this is a function of the template. I just tried a blog layout in the Joomla! sample website (with the default of 1 leading and 2 columns) and, with 3 articles, it goes:

----1----
-2-
-3-

If you add a 4th article, then you get the second column:

----1----
-2- -4-
-3-

I guess that's the way it is designed to work. Seems a bit odd to me. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Thu Jul 17, 2008 4:56 pm

I first noticed this issue years ago, and finally just had to move on. I often said the answer would probably be easy but I never thought it would be this easy. I just created a new section/category and 4 new articles and a menu. omg, it works. In the past, I've NEVER added a fourth article. In my particular case, in this category/blog I only wanted three articles max. I am relieved and frustrated at the same time. Why on earth would it lay out like that?

Thanks to all who helped me through this. I learned other stuff along the way, such as why my global author/created/modified settings weren't working.

EDITED: Um... Am I going to face this issue creating category blogs with 7 into articles?

ARTICLE 1
2 | 4
3 | 5
6 | 8
7 | 9
Last edited by sixeyeco on Sat Jul 19, 2008 3:03 pm, edited 1 time in total.

jchawa
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Jul 19, 2008 6:03 am

Re: Order of Articles in Category Blog Layout

Post by jchawa » Sat Jul 19, 2008 6:11 am

Good detective work guys!

Now I have to wonder if there are configurable parameters from where we can change the order the articles show.

It's hard to believe that joomla developers 'hard code' such an obviously limiting and important parameter. As someone else before me mentioned, article publishing is what CMS is all about, right!

G

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 19, 2008 2:36 pm

Hi. This is a known issue and as far as I know there are no parameters to control this. It should be possible to do a template override to change this, but I don't know enough about PHP (yet!) to do this. Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Sat Jul 19, 2008 3:32 pm

I think I found the code that is responsible for this issue..
It's in a file called blog.php which is found here: components\com_content\views\category\tmpl

Code: Select all

		<?php
			$divider = '';
			for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
				if ($z > 0) : $divider = " column_separator"; endif; ?>
				<td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
				<?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
					if ($i < $this->total && $i < ($numIntroArticles)) :
						$this->item =& $this->getItem($i, $this->params);
						echo $this->loadTemplate('item');
						$i ++;
					endif;
				endfor; ?>
				</td>
		<?php endfor; ?>
Now, can someone better than me verify that this is the offending code and, better still, fix it?

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 19, 2008 3:48 pm

Hi. With my limited knowledge, I think this looks right. If you compare it to the "default.php" file in the "components\com_content\views\frontpage\tmpl" directory, it is similar but with some differences. I might try looking at this to see if I can just lift some of the code from the frontpage file. I love coding when I don't really know what I'm doing. You never know what might happen!

By the way, I think it would be better to do this as a template override. That way the "hack" is a separate file outside of the joomla directories.

Thanks. Mark
Mark Dexter
"Well...how did I get here?"

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 19, 2008 6:30 pm

Hi. I think I've got it for the category blog. I tested it as a template override. I just replaced the for loop in lines 51 - 62 with lines 35-54 (the nested for loops) from the frontpage default.php file. I did some quick testing and it seems to lay out the same way as the front page (across columns instead of down columns). I've attached the file so you don't have to do any editing, but I had to rename it to blog.txt to be able to upload it.

Here are the steps to try it.

1. Create the override directory "<your joomla! home>/templates/<your template>/html/com_content/category".
2. Copy the attached file "blog.txt" to the new directory. Rename it to "blog.php".

That should be all you need to do. If for some reason it causes problems, just delete the "blog.php" file (or rename it back to "blog.txt") in the new directory, and it will revert back to the default behavior -- the beauty of template overrides.

Please try it and let me know. I'm going to try this with the section blog as well. I'll post back with that file. Thanks. Mark
[EDIT: I found a glitch. The links at the bottom of the blog are not right. I'm looking at this now. Mark]

[EDIT: Fixed the glitch. It should work now. There is a bug in core (1.5.4) so that # Links parameter is ignored. But it's not my bug!]
You do not have the required permissions to view the files attached to this post.
Mark Dexter
"Well...how did I get here?"

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sat Jul 19, 2008 6:51 pm

Hi. Here is the file for the section blog. Same exact idea as the category blog, just replace the for loop in lines 51 - 62 (blog.php) with lines 35 - 54 in frontpage default.php and put into the template override directory. Again, I've attached a .txt file. Here are the detailed instructions.

1. Create a directory called <your joomla home>/templates/<your template>/html/com_content/section".
2. Copy the attached file "blog.txt" into this directory and rename it "blog.php".

If for some reason it causes problems, just delete the file. Again, please let me know if this works for you. Thanks. Mark

[EDIT: I found a glitch. The links at the bottom of the blog are not right. I'm looking at this now. Mark]
[EDIT: Glitch fixed. File should work now. Mark]
You do not have the required permissions to view the files attached to this post.
Mark Dexter
"Well...how did I get here?"

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Sun Jul 20, 2008 6:41 pm

Hi. Both of these files should be good to go. If you try them, please post back with the results. Thanks. Mark
Mark Dexter
"Well...how did I get here?"

User avatar
Joyce Mar
Joomla! Guru
Joomla! Guru
Posts: 893
Joined: Tue Sep 18, 2007 1:54 am
Location: Cairns, Australia

Re: Order of Articles in Category Blog Layout

Post by Joyce Mar » Tue Jul 22, 2008 11:59 pm

Just tried them both out and it's working great so far. Thanks very much for your efforts.

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Wed Jul 23, 2008 3:21 am

Hi Joyce. Thanks for posting back. Now I know that it works at least for one other person! Mark
Mark Dexter
"Well...how did I get here?"

sixeyeco
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Fri Feb 15, 2008 2:37 pm

Re: Order of Articles in Category Blog Layout

Post by sixeyeco » Wed Jul 23, 2008 5:08 am

I was afk for a few days. Just checked back and saw your post. Way to go. This has been a needle in my side for some time. Great work. Thank you!

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Wed Jul 23, 2008 5:55 am

Hi. I would very much appreciate it if you could post back after you try it, to make sure it works for you. Thanks. Mark
Mark Dexter
"Well...how did I get here?"

Macjoomla
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Sep 02, 2005 9:34 am

Re: Order of Articles in Category Blog Layout

Post by Macjoomla » Fri Jul 25, 2008 10:25 pm

dextercowley wrote:Hi. I would very much appreciate it if you could post back after you try it, to make sure it works for you. Thanks. Mark
I have been lucky to find your thread, thank you for blog.php, thats works fine with my Joomla 1.5.4 and integrated ja_purity template. Just one little question. Why do the content items in the second (and third and so on) row do not start each at the same hight, as we have been used to in Joomla 1.0 or even in beez with Joomla 1.5? Would it be possible to do so…?

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Order of Articles in Category Blog Layout

Post by dextercowley » Fri Jul 25, 2008 11:02 pm

Hi. Unfortunately, I don't know much about how blog layouts worked in 1.0. I have only really worked with 1.5. I would guess that the answer is that we are not using tables in 1.5, so there is no concept of "rows" to line up. We are just stacking articles on top of each other in two columns, so the one will start just below the one above.

I think we are getting the across numbering just by "shuffling" the articles and then stacking them on top of each other.

I'm glad this worked for you. Now that I've had some positive results from others, I'll write up a Tip article. Thanks for posting back. Mark
Mark Dexter
"Well...how did I get here?"

warning
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Jul 26, 2008 4:11 pm

Re: [SOLVED] Order of Articles in Category Blog Layout

Post by warning » Sat Jul 26, 2008 5:01 pm

Hi all,

I have similar problem. I have articles with large graphics in tables with full page width. The problem is, I am not able to put all of them in 1 column because only the first item appearing correctly. But from the second item, it is splitting to two columns...

What I would like:
2.gif
My settings for Category Blog Layout:
1.gif

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


Locked

Return to “Administration 1.5”