Understanding Embedded URL Generation
capt_kirk
Joined: 2006-01-24
Posts: 492 |
![]() |
Valiant (or someone else who understands this), I've working on refactoring G2Image to add LightBox support among other things. I've figured out how to use the URL generator to get derivatives, but the URL that I'm getting is a little strange. In the embedding initialization, I'm using (from WPG2's options table) $option["g2Uri"] = http://localhost/gallery2/ $option["embedUri"] = http://localhost/wordpress/index.php/wpg2 I would expect a URL for a thumbnail or a resize to look something like /wordpress/index.php/wpg2?g2_itemId=28 But I'm only getting wpg2?g2_itemId=28 Do you have any quick insight into why this is happening? If not, I'll dive into the code, but I was hoping you could save me some time. Thanks, |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
This has to do with PHP PathInfo (index.php/wpg2) and how G2 interprets the embedUri. And G2's url generator tries to generate relative URLs (because they're shorter) by default. So G2 thinks that it can drop the index.php part. And that's fine, usually. If you're working out of the normal context and need server-relative or even full URLs, use the appropriate URL generator options. -------------- |
|
capt_kirk
Joined: 2006-01-24
Posts: 492 |
![]() |
Thanks. This did the trick:
It gave me the full embedded URL I was looking for. |
|