OK, thanks Ken. In the meantime, here is another exciting ItemID solution. Quite long again, I'm afraid, but hopefully reasonably clear. Please point out any errors. Took me a while to solve this problem (in Mambo 4.5.1, but same in Joomla from what I can tell), so heartily sick of it now and I may have missed some important ramifications.
This one relates to that useful feature of
blog listings where you can
show each content item's category name and make that name linkable.Unfortunately, if you don't fix things, it turns out to be a
totally useless feature and gets you into a complete mess with different URLs all over the place to the same content items. That's
BAD.The problem is that the automatically generated link goes to a
Table - Content Category type listing rather than a
Blog - Content Category listing.
The effect of that is that the links to content items in the category listing take their ItemID from the
Table - Content Category . The links to the very same content items in the
Blog - Content Section listing take their ItemID from that blog listing. So they are different.
Not only will that screw up your Google ranking, but also make modules which you thought were going to show up with your content items suddenly disappear from view. If you don't happen to have a
Table - Content Category link already in your menu for that category, you won't even be able to assign any modules to the content items reached via that route!
The accepted way of sorting this kind of thing out is to make a
Table - Content Section (or "List - Content Section" in older terminology) link in your menu for the relevant
Section. It doesn't have to be visible, but it must be published: you can hide it under another, unpublished, menu item; or you can create a separate menu for all such links which you then assign to a non-existent module position.
This works (usually) because the
Table - Content Section ItemID is supposed to take precedence over everything else, so all content items from that section always have that ItemID - CONSISTENCY! Yippee! :o
You can then also assign modules to that
Table - Content Section menu item and they will appear on your content items.
If the
Table - Content Section link is not itself required and can be hidden (ie. you are only using blog listings), it can actually be quite useful, in fact, to have a blog listing with one set of modules assigned and then different modules assigned to the content items themselves when they are read (eg. mod_related_items).
Note that there are disadvantages too: it completely screws up your pathway for a start. It will also ruin any plans you may have had to highlight the active section or category within your menu structure.The other disadvantage is that, in this particular case, it doesn't work!
Or rather, it does work for the
Blog - Content Section listing part of the equation (ItemIDs there now come from the new
Table - Content Section menu item), but once you follow the link to the
Table - Content Category listing, ItemIDs continue to be assigned from that and are
not read from the menu link you have just so smugly created. It is tempting to conclude at this point that it would be quicker and less hassle to sod it and hand-code the entire site. Especially since you have read above, in this thread, that Section lists take precedence over Category lists.
Don't fight it. Don't delete your new magic menu item. Don't despair. If you make appropriate parameter choices, there isn't much visual difference between a table and a blog listing anyway -
so just make the automatic link point to a "Blog - Content Category" listing instead! Blog listings of any kind are powerless in the face of your new magic menu item. This is how you do it:
Find the file
components/com_content/content.phpFind the following line: (under the comment
// loads the link for Category name )
Code:
$link = sefRelToAbs( 'index.php?option=com_content&task=category§ionid='. $row->sectionid .'&id='. $row->catid .'&Itemid='.$_Itemid );
Change it to:
Code:
$link = sefRelToAbs( 'index.php?option=com_content&task=blogcategory&id='. $row->catid .'&Itemid='.$_Itemid );
That's it.
Except that you will now want to make some
Blog - Content Category menu items for the relevant categories so that you can control the parameters (if you don't already have them). They can be in your hidden menu if you don't need them for anything else.
You've earned a beer now. Relax. Breathe deeply.