Recently, I've noticed that a manual URI configuration bug which was filled under http://drupal.org/node/160783 got patched resulted in a couple of inconsistencies that I am hope to address here:
While configuring "Gallery Settings Install" page, the module prompts for a number of settings such as:
Gallery2 URL or URI: /photo2/
Gallery2 filesystem path: /wwwroot/drupal/photo2
Embed URI: index.php?q=gallery
I assumed that if one specifies URL such as /photo2/ that Embed URI will concatenate the two fields "URL+URI" afterwards and apply going forward. instead, it appears that it simply ignores URL and construct the following final url: http://www.domain.com/index.php?q=gallery
If I manually add '/photo2/' to URI which results in http://www.domain.com/photo2/index.php?q=gallery, it works great for the "Gallery Image Block". So you would expect that anytime a user makes a call into "http://www.domain.com/gallery" they would get redirected to /photo2/main.php?q=gallery or in the worth case "Page not found". That obviously doesn't happen and instead Drupal loads G2 assuming that you have requested an embedded URL page.
Sorry for convoluted way of explaining it. I could also provide snapshots if required.
Thanks.
Comments
Comment #1
profix898 commentedI'm not sure I got your point :( What exactly is the bug here? Sounds like the code does what it should, not? However I will try to explain!
I think URL means 'Gallery2 URL or URI', right? These two field however are not related. 'Gallery2 URL or URI' and 'Gallery2 filesystem path' are both referring to the location where Gallery2 is installed. But 'Embed URI' is the Drupal path, where embedded G2 is referenced.
Comment #2
mike15 commentedYour point is well taken. So now I would like to understand why when manually specifying Embed URI as
Embed URI: photo2/index.php?q=gallery, the Drupal is still answers to URL calls when referenced as http://www.domain.com/index.php?q=gallery instead of http://www.domain.com/photo2/index.php?q=galleryIt seems that a default URI is hard-coded somewhere else in the code since it is inconsistent like I said before, the proper URI is referenced when accessing Gallery Block.
Comment #3
profix898 commentedThe Embed URI value is mainly passed to G2 for the urlGenerator, which is responsible for generating the urls for albums/images. Paths containing
/?q=gallery/cause Drupal to display the gallery page, all the rest is handled by G2 internally. You can think of Drupal as a wrapper responding on /?q=gallery and passing the query to G2 to resolve the actual path and display the appropriate page. Thats the reason why most people with a wrong Embed URI value can still access the Gallery page, but all paths to albums/images appear broken.Comment #4
mike15 commentedOK, I think I understand the meaning of the Embed URI now. I guess I was trying to circumvent it, by utilizing it for something else :)
Here is my situation and there might be other people in the same boat:
I have yet to find a theme that would allow me to accommodate Drupal and Gallery under one roof (embedded) so I've made a decision to keep them separate for now. Now, I'd like to use some of the great features this module provides, but it seems to me that a major concentration is made on embedding the G2 and not enough attention is allocated to a semi-stand alone G2 implementation.
I am starting to realize that some of the features that I am using weren't developed for a stand alone G2 and that is why I am seeing some of the inconsistencies in Drupal behavior.
So hopefully, you understand the point I am trying to make here... I am simply offering to make a new feature if you would agree that it belongs to this module and add a new field called "G2 Standalone" or something to allow to accommodate situations such as mine in this case.
Comment #5
profix898 commentedTrue, thats a valid point. We have asked the G2 devs to implement a feature, which allow us to get an 'un-themed' representation of albums/images from G2. This would greatly simplify the task to integrate Gallery2 visually, because we could use Drupal theme system to render the actual ouput. However new embedded features are not on the roadmap for Gallery 2.3 (and I somehow doubt we will get them in 2.4 or stg).
Some other integration solutions like Wordpress are maintaining an embedded version of the G2 default theme 'Matrix'. MatrixEmbedded is mainly a modification of the original Matrix theme targeted to improve the visual consistency between G2 and Wordpress. We have thought to do the same for Drupal. But we decided that maintaining a theme (besides the module code) is almost impossible with our limited resources. I spent a lot of time developing/improving the module and neither I have time nor the designer skills to maintain an embedded theme.
The gallery.module was never meant for semi-embedded operation. Nor was Gallery2's API. Actually we are trying to get G2 closer to Drupal with every version of the module. In fact I'm currently working on a 'gallery_content' module, that will import G2 albums/photos into Drupal (without duplicating the actual images/data). Thats a huge step forward as it automatically allow integration with the Views module, the Comment module and with some additional code to render the whole gallery page utilizing the Drupal theme system. It will - by far - not provide the same amount of functionality (image frames, etc.) and maintaining the gallery will still require to use G2 directly. But we will have a (perfect?) visual integration and addition feature will come one-by-one ... People using this module will even see more inconsistencies between embedded and standalone G2, but as mentioned before using G2 standalone at the same time as embedded G2 was never really considered.
You are very welcome to contribute to the module :) Can you be a little more specific about what options/features you would like to see for semi-embedded G2 and how you think to get there. (Maybe we can retitle this issue or make a new about semi-embedded features?)
Comment #6
czeky commentedHi, Profix898, is it okay to have The Embed URI without "index?q=", just the "gallery" . I'm writting this, because of my problem with bad language switching (many thanx for responses). This would solve my problem.. URL "/en/gallery&g2_itemId=1239" works, but url "en/index.php?q=gallery&g2_itemId=1239" does not work as expected.. Know it's not a good solution, but it would be working.
Many thanx.
Zdenek
Comment #7
profix898 commented@czeky: If it works you can use whatever Embed URI value you like ;) The ?q= notation (despite urlrewrite) is needed for IIS-compatibility.
Comment #8
czeky commentedMany thanx, I must appologize, my stupid mistake, I' using (need to) my custom language switcher, not the i18n one, it's done in template, which is not of course sending a language (variable?). So... do You know how to send a language variable from my own menu, which is embedded in template in style ? Any type of php command get lang of something like this on the link?
thanx again
Comment #9
czeky commented$language = i18n_get_lang();this is how to get language, now I need output from this to Embed URIlike : /pages/
print $language;/index.php?q=galleryis it okay to add php variable comman into embed URI field?
thanx
Comment #10
mike15 commentedUnfortunately, I am not a developer to be able to suggest/offer a code but have been actively involved in helping to improve the UI where I thought it would advance the module :)
In regards to semi-embedded G2 features, I would like to simply be able to open a separate window when a user requests embedded URL such as "index.php?q=gallery". Today, I don't believe there is a way to redirect URI or prevent Drupal from embedding the G2 into Drupal theme. "Gallery image block" plays a perfect example here by bringing any particular image from G2 and allowing one to add to Drupal index page and yet upon clicking on the image would open a non-embedded G2 site. This is what I would imagine the semi-embedded G2 module feature could do by utilizing the features of the module such as image block, user sync and etc but yet presenting the two applications independently.
Does that make sense? Can that be done today or would it require you to make huge changes to the existing code?
Thanks,
Comment #11
profix898 commentedChanging title, marking this a 'feature request' (and 'postponed' until 5.x-2.x is stable and D6 version is ready). Feel free to collect some more ideas about how 'semi-embedded' G2 should look/be like. We will discuss this in a few weeks ...
Comment #12
mike15 commentedGreat. Thanks!
Comment #13
profix898 commented@mike15: You might also be interested in 'Tighter integration' (http://drupal.org/node/138400). Solving that issue possibly renders this one obsolete!?