Home Short URLs (without categroy part) How to propagate SectionEx links to the entire Joomla! framework
How to propagate SectionEx links to the entire Joomla! framework PDF Print E-mail
Written by Riccardo Budini   
Sunday, 16 March 2008 00:52
1. INTRODUCTION

SectionEx is a perfect component for listing sections and categories in a single layout with many options and filters.

 

1.a How joomla works (skip if you already know)


J! Framework generates sef urls on the basis of main menu structure for those contents under a section or category
linked in main menu.


A typical url is: mysection/mycategory/xx-mycategory/yy-myarticle.html
for a main menu structure like:


mysection ------------------------ section-blog
|____ my category -------------- category-blog


Alternatively (and cleaner): mysection/xx-mycategory/yy-myarticle.html

for a main menu structure like:

mysection -------------- section-blog

If no menu item is setup for mysection or mycategory url will be:

component/content/article/xx-mysection/yy-myarticle.html

If a user does'nt create multiple internal links to the same section or category no duplicates will be generated by Joomla
itself. By the way If you need for example to replicate main menu items in other menus use external links. This is the
well known golden rule to avoid duplicated ids/urls.


1.b How sectionEx works (skip this too if you already know)


SectionEx works the same J! way. Tought J! Framework is not capable to track sectionEx main menu item outside
sectionEx component pages.
This means if you have some links of myarticle.html out of sectionEx layout (e.g. In frontpage blog, in popular module,
etc.) they would be linked as:


component/content/article/xx-mysection/yy-myarticle.html

 

even, if you have enabled navigation links you'll have those urls for < prev and next > inside sectionEx layout winding
up to a non-shaped page.

 

2. SOLUTION

To uniform Joomla! Framework generated urls to sectionEx generated ones follow these steps.


2.a You need to instruct Joomla! to generate urls inside mysection (and consequently inside mycategory) the same way
sectionEx does:


- create a main menu item mysection ------- section blog layout
- just below create the sectionEx menu item pointing to mysection.

 

admin

 

2.b Now it already works, but you'll notice you have 2 links in main menu. Then we have to hide (no delete, nor
unpublish) the first one:

you have to add these lines to your stylesheet (tested in ffox2 and I.E.6) :

 

For standard Rhuk MilkyWay template (has a vertical mainmenu in a module):

div.module_menu li.item3 { /* item # depends on the position of menu item you want to hide, 3 is just an example*/
visibility: hidden; /* for compatibilty I.E. 6 don't use collapse */
width:0; /*collapse the horizontal blank space left */
height:0; /*collapse the vertical blank space left */
margin:auto !important;
margin:-15px; /* for I.E. 6 */
}

 

For a generic template with horizontal mainmenu (you may have to adjust it a bit according to your template classes)

div#menu li.item3 { /* item number depends on the position of menu item you want to hide, 3 is just an example*/
visibility: hidden; /* for compatibilty I.E. 6 don't use collapse */
width:0; /*collapse the blank space left */
clear:none !important;
clear:both; /* for I.E. 6 */ }

 

you're done.

 

Final notes


Advantages:
1. Urls Uniformity. All urls for myarticle.html will be uniformly generated and you can navigate seamlessy
inside/outside sectionEx, all frontpage blog links wind up to the right assigned page, breadcrumbs will point to
sectionEx layout. All modules links like popular or latest will point to the page assigned.
2. When you click on <prev or next> navigation links you'll remain inside sectionEx menu.
3. SectionEx menu will be always correctly highlighted, when you're arriving from a whatever j! Link.
4. Reversibilty: if one day you decide to quit using sectionEx you only need to unpublish or delete sectionEx
menu item, delete .css class. You'll revert to standard section blog layout and you won't loose your urls for
your whole content.


Disadvantages:
1. You need to add those lines to you stylesheet, and if you eventually need to change menu ordering you might
have to update item id # in .css line 1.

 

Download as a .pdf

 

A warm thank to Robert Kuster who kindly made possible to share this and for his valuable support!


Riccardo Budini www.provisum-studio.com

Soon (in about 2 weeks) I'll publish my site and a showcase of this how-to at www.provisum-illumna.com (still off-line at the moment)

 

 

 

Last Updated ( Saturday, 24 May 2008 15:30 )