This is an inelegant workaround, but it works, with some limitations.
Before anything, I go on to state the problem:
Recently, when I wanted to use the Phocagallery Menu/Tree Module, I found out that, if the Module wasn't assigned to "All" pages, it disappeared when I clicked on any of its menu items... To solve this problem, without SEO mode in Joomla, only had to replace this line of code (just before "return ($link);"):
Code: Select all
$link = JRoute::_('index.php?option=com_phocagallery&view=category&id='. $catid_slug .'&Itemid='.$itemId);
Code: Select all
$link = JRoute::_('index.php?option=com_phocagallery&view=category&id='. $catid_slug .'&Itemid='.$_GET['Itemid']);
in its correspondent file (mod_phocagallery_menu.php or mod_phocagallery_tree.php).
In this way, menu or tree module works properly... without SEO mode.
Well, when I've tried out it activating SEO + mod_rewrite in Joomla (1.5.14, in my case), this problem turns to occur, and the anterior mend doesn't serve... The Phocagallery Menu/Tree module disappears when the user clicks on any of its menu items, if you don't assign this Menu/Tree module to “All”… In my case, that solution (assign the module to "All") was not satisfactory.
So, I've made the following workaround.
IMPORTANT! Note that, for this to work, you can not have any numbers neither in the name of your site, nor in the page name where you place the Menu, because it would conflict with the code entered.
1) To change, in its correspondent file, the code line above mentioned:
Code: Select all
$link = JRoute::_('index.php?option=com_phocagallery&view=category&id='. $catid_slug .'&Itemid='.$itemId);
Code: Select all
// URL DETECT
if (preg_match('#([0-9]+)#',$pageURL,$num)) {
$pageURL = $pageURL;
} else {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] .'/';
}
}
// URL CLEAN
preg_match('#([0-9]+)#',$pageURL,$num);
$numero = $num[1];
if ($numero != "") {
$urlSeperate = explode($numero, $pageURL, 2);
$urlClean = $urlSeperate[1];
$pageURLclean = str_replace($urlClean,"",$pageURL);
$pageURL = str_replace($numero,"",$pageURLclean);
}
$pageURL = str_replace("component/phocagallery/category/","YOUR-SEO-PAGE-NAME-WITH-MENU-or-TREE-MODULE",$pageURL);
// LOAD URL PAGE + PHOCA ITEM MENU
$link = JRoute::_($pageURL. $_GET['Itemid'] .'/'. $catid_slug);
2) To insert, in the .htaccess in Joomla root, in any place between the line:
Code: Select all
########## End - Rewrite rules to block out some common exploits
Code: Select all
########## Begin - Joomla! core SEF Section
Code: Select all
RewriteRule ^component/phocagallery/category/(.*)$ index.php?option=com_phocagallery&view=category&id=$1&Itemid=YOUR-ITEMID-PAGE-NUMBER
RewriteRule ^YOUR-SEO-PAGE-NAME-WITH-MENU-or-TREE-MODULE/(.*)/(.*)$ index.php?option=com_phocagallery&view=category&id=$2&Itemid=$1
It's an inelegant workaround for several reasons:
a) It combines two different SEO nomenclatures, one for the galleries (your-website-name/your-page-name/your-ItemID/your-category), other for galleries containers (your-website-name/component/phocagallery/category/your-ItemID/your-category). It was necessary, because, if not, the Menu/Tree Module turned to disappear when the user clicked on a category thumbnail. I don't know how unify this nomenclatures.
b) It needs a non-variable-name (your-page-name) in php code. Sorry, I haven't achieved to avoid this.
c) It needs to introduce specifics RewriteRules in .htaccess
d) It requires no-number-url-names.
And, on the other hand, it doesn't solve other problem: at the least in my case, the Download Icon of Menu/Tree Module doesn't work properly in SEO Mode. If someone knows how to solve this problem, I would be grateful if inform me how to get it...
Well; in any case, you can see an example of Phocagallery Menu Module working in this way with SEO and mod_rewrite, in vertical disposition on leftcolumn, in http://mundojoomla.org/fotografia. It's a spanish website.
Other example, in this case in horizontal disposition, in http://ignacioiglesias.com/joomla. English.
Regards,
Nacho