|
Title: [NOT A BUG]Passing Itemid from rsitems module picture link for multiple template Post by: ewoodlore on April 19, 2008, 08:05:09 AM Hi all, thanks in advance for your help.
I have a site that uses multiple templates for several businesses running off one central database and set of code. I have created menu items to specific galleries that are then assigned to each template via the page control module and/or by the assign feature in templates. That works great. I also created several rsitem modules, set each to only display on each specific template, and to only display specific galleries that are associated with each specific template. Where I run into the problem is that when a user clicks on any image in the module on any template, the cookie or template identifier is not passed, while the link automatically assumes the last RSGallery2 menu item Itemid. So what happens, is that the template associated with that Itemid is always shown instead of the template from which the person clicked on the link. I've looked at the code in the /modules/mod_rsitems.php file and found this: Quote //get Itemid from menutable $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE published = 1" . "\n AND link = 'index.php?option=com_rsgallery2'" . "\n ORDER BY link" ; $database->setQuery( $query ); $RSG2Itemidobj = $database->loadObjectList(); if (count($RSG2Itemidobj) > 0) $RSG2Itemid = $RSG2Itemidobj[0]->id; Is there a way I can grab the current template cookie or Itemid from the page I'm on and pass it with the link. Lastly, I'm using OpenSEF, so most of my pages aren't physically displaying Itemid in the URL. Will this prevent me from using a $HTTP_GET_VARS to pass the Itemid? Thanks for your attention and assistance. Title: Re: Passing Itemid from rsitems module picture link for multiple template site Post by: ewoodlore on April 23, 2008, 04:29:28 AM I did something major wrong and brought down our DEV site. Here's what I did:
1. I downloaded a copy of /modules/mod_rsitems.php to try to fix the gallery linking problem. 2. I made a one line tweak to test the code: Original Line: $RSG2Itemid = $RSG2Itemidobj[0]->id; I added after that line: $RSG2Itemid = $RSG2Itemidobj[277]->id; to see if I could force the ItemID in the URL (it was only a test!) 3. I uploaded / overwrote the file ad refreshed the page. I got this error: We're sorry but the page you requested could not be found. We have OpenSEF running but any page I try to go to is broken. 4. I reinstalled the backed-up copy and still keep getting the same error. 5. Thinking I could easily fix this problem, I uninstalled the rsitems module. Still same errors. 6 I reinstalled the rsitems module and still get the smae errors, but now I have to recreate the 6 copies of the rsitems modules I had throughout my templates. Please help! What did I do? I noticed that I can't access the Jevents calendar in the backend and in the frontend, I get a warning: Events Calendar This module needs the Events component How did my little test break another component? Title: Re: Passing Itemid from rsitems module picture link for multiple template site Post by: ewoodlore on April 23, 2008, 04:31:06 AM I'm guessing from my limited knowledge of SQL, but I must have changed the database by injecting the 277 number? Am I an idiot or what?
Title: Re: Passing Itemid from rsitems module picture link for multiple templates [SOLV Post by: ewoodlore on April 23, 2008, 06:51:18 AM I figured out what was wrong and feel even dumber than before. Somewhere after making my first or second FTP transfer, I must have clicked some button in the FTP program that renamed my components folder to httpdocs. Once I changed my folder name back, almost everything works, except for my Jevents Calendar module, but I'm working on that now! Sorry everyone for the false alarm!
Title: Re: [NOT A BUG]Passing Itemid from rsitems module picture link for multiple temp Post by: ewoodlore on April 30, 2008, 06:36:50 AM Now that I was able to resolve my nightmare that was caused by my stupidity, I was wondering if anyone can help me address my initial post in this thread? I would be much obliged! Thank you!
Title: Re: [NOT A BUG]Passing Itemid from rsitems module picture link for multiple temp Post by: ewoodlore on May 07, 2008, 04:47:13 AM So, I have found a temporary solution for making sure my RS Items module passes the correct ItemID (that is related to a specific template) so that the gallery page that is opened maintains the correct site template. It's not a suitable workaround because as soon as a new gallery or menu item is added, it will need to be hardcoded in the mod_rsitems.php file. Here's what I did for the random image function at roughly line 278:
Quote switch ($catid_a) { case "1": case "2": case "3": case "19": case "20": case "21": case "22": $RSG2Itemid = 269; break; case "4": case "24": case "25": case "26": case "5": case "6": $RSG2Itemid = 272; break; case "7": case "11": case "8": case "9": case "10": case "12": $RSG2Itemid = 275; break; case "13": case "14": case "15": case "27": $RSG2Itemid = 277; break; case "23": $RSG2Itemid = 279; break; case "16": case "17": case "18": case "28": $RSG2Itemid = 281; break; } The ideal solution would be to query the fields where we assign what galleries are selected to display in that RS Items module (I have one for each template, so 7 copies of rsitems module), and cross reference those galleries (from each module) with the menu ItemID that they are called in. Is there a way to do this? Thanks to anyone for their help or suggestions in advance! |