Ever wonered how to link to a content item without first creating a menu item? Read on if you want to find out the shortcut.
Joomla! content item urls are always in the same format:
Section Blog Layout
https://www.yoursite.com/index.php?
option=com_content&task=blogsection&id=XX&Itemid=YY
where:
XX = the ID of the content SECTION
and
YY = the ID of the MENU ITEM
Section Table Layout
https://www.yoursite.com/index.php?
option=com_content&task=section&id=XX&Itemid=YY
where:
XX = the ID of the content SECTION
and
YY = the ID of the MENU ITEM
Categroy Blog Layout
https://www.yoursite.com/index.php?
option=com_content&task=blogcategory&id=XX&Itemid=YY
where:
XX = the ID of the content CATEGORY
and
YY = the ID of the MENU ITEM
Categroy Table Layout
https://www.yoursite.com/index.php?
option=com_content&task=category§ionid=WW&id=XX&Itemid=YY
where:
WW = the ID of the content SECTION
,
XX = the ID of the content CATEGORY
and
YY = the ID of the MENU ITEM
Individual Item Layout
https://www.yoursite.com/index.php?
option=com_content&task=view&id=XX&Itemid=YY
where:
XX = the ID of the content ITEM
and
YY = the ID of the MENU ITEM
Menu Item? What menu item?
Wasn't this post supposed to be about linking to a content item with first creating a menu item?
You're absolutely right, this post is all about linking to a Joomla content item without first having to create a menu item.
I'm going to show you a Joomla shorcut that you're unlikely to find anywhere else, probably because it's essentially cheating :) We're tricking Joomla into thinking it's doing something that in reality it isn't.
The first thing you need to do when creating a dummy "link" is to find out the ID number of the section, category and/or content item you want to link to and decide which of the above page layouts you want to acheive.
Say for example we wanted to create a link for a content ITEM, these are the steps we would follow:
- Go to the content item and find its ID
- Replace XX with the ID number for the content item we're linking to.
- Replace YY with the ID number for the dummy "menu item"
*Tip... By using the menu item number from an existing page we can copy it's module structure. If we want to create a page with no modules the we have to use the menu item ID for a similar page with no modules assigned to it. - link to the content item with the following url: https://www.yoursite.com/index.php?option=com_content&task=view&id=XX&Itemid=YY