I want to integrate Gallery2 into my site. There are 2 specific areas I am concerned about.
1) My site has different sections. There is a central registration for the entire site. After that, users can choose to register for any section independently.
For the gallery section, initially users could only view photos uploaded by me. So, registration was not quite needed there.
But now, I have decided to make a separate album titled users, under which each user can create a single sub-album into which only he/she can upload photos (off-course including the admin). I want the users to indicate in their central profile that they would like to register for this, after which they can perform the above mentioned activity.
2) The site has a left, right, top & bottom bars. There's a main content area in the middle which is approx. 680 px wide. I have choosen Carbon as my theme. I want the dynamic sidebar which appears on clicking a link to remain that way, But I want to move everyting else inside the main content area.
After some analysis of the Gallery2 code, I have comeout with 2 options: either, dig deep into the code & perform alterations, or simply allow the content to be generated, but just before it is sent to the browser, intercept it. As it is xHTML, I can easily parse it using XML libraries & insert or strip-off desired sections.
So, which one is the better choice. Also, can you point me to specific resources that can help me achieve above 2 objectives????
Posts: 7
There are a few ways to do this. Here is one technique that I have tried based on an example here http://gallery.menalto.com/files/sample_embedding_wrapper.zip
with this method you can just get the data object from a gallery request by collecting the 'themeData' value (i.e. no html layout - so you can do what you want with the data).
WARNING: this is actually totally raw and untested code that I have knocked together quickly - it may not work off the bat - but it is just to give an idea how to intercept data before it is rendered by the gallery template.
There is also the full embed method that get you access to the core API - and then you don't need to start editing G2 code (which I advise against - hacking the code may give quick results but could prove to be a nightmare to maintain).
do full embed like this . . .
Now you can make calls to Core API typically like this
when doing the full embed you don't need to bother with GalleryEmbed::handleRequest().
Hope this helps a bit.
The 2 main docs on this subject are
http://codex.gallery2.org/Gallery2:Embedding:Integration
http://codex.gallery2.org/Gallery2:Embedding
Posts: 2
Exactly, I myself did not want to work with G2 code directly. You say that might give quick results, but my experience says that hacking into that code would take a lot of time and patience, for a product of that complexity.
Anyways, I am not looking to do that, so let's put that aside.
For some reasons, I had to put aside my Gallery project aside for a while, and move on to another one. It might take a while (approx. 1 month) to get back to it. So, I will be able to test & utilize that code only then, and discuss my results, and any further issues I might have.
Thanx for the reply...