URL Rewrite for downloads not taking effect
|
pnear
Joined: 2003-08-12
Posts: 18 |
Posted: Tue, 2005-09-13 17:09
|
|
URL Rewrite is working on my site, but the download links are not getting the proper URL applied to them on the album page. Sample page: Anchor tag construction from photo.tpl URL generated for the downloaditem link on that page: Settings in the URLRewrite Config: Just updated to G2 1.0 via CVS this morning (this update didn't change anything, just noted to let you know what version I'm on). Any thoughts? Pete |
|

Posts: 32509
nope, what g2 does is correct. it's just not well documented.
itemId and serial must be part of the url, if you leave them out, g2 will add them as normal url parameters.
recommendations: leave it as:
d/%itemId%-%serialNumber%/%fileName%
Posts: 18
Sorry, I should have noted that as well. It doesn't work with the default settings either, I changed them mostly to do some troubleshooting. I've reverted back to the setting you posted above, and am seeing the same behaviour.
Pete
Posts: 16503
Try it with a different theme. This could be in how that theme creates the link. I've seen this before when playing around with "click on image for fullsize".
Actually changing themes won't help, I think this is how the themes work to generate the URL to download, they are hardcoded for that URL and don't "request" the URL from Gallery.
An example of a download link URL from the Matrix theme:
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}"> {g->text text="Download %s in original format" arg1=$theme.sourceImage.itemTypeName.1} </a>An example of the generated img URL from teh Matrix theme (without image frames)
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}Also, I didn't look at the WPG2 theme to confirm, but I'm pretty sure it does the same. Maybe one of the devs can point in the right direction of how to correctly get the URL for the download item so that it uses the URL Rewrite stuff if enabled.
Posts: 32509
i don't believe it
please double and triple check.
go to site admin -> url rewrite
enter the above rule (d/%itemId%-%serialNumber%/%fileName%) for the download item requests.
hit save.
Posts: 16503
I think found the problem, or at least a problem. There appears to be a minor typo in photo.tpl of the WPG2 theme:
<a href="{g->url arg1="view=core:DownloadItem" arg2="itemId=`$theme.item.id`"}">Instead of
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">Note the period (.) instead of the colon (
bewteen core and DownloadItem
I did a test on my site, http://photos.kevinnehls.com/v/G2Forums/netflix_voting0.png.html you'll see 2 download item links, one uses the short URL the other uses the long one. The short one is generated using core.DownloadItem, the long one is generated using core:DownloadItem
Looks like ozgreg needs to fix that if it's not fixed in the current version
Posts: 18
That was it! So, I grabbed the photo.tpl file from the siriux.net theme. Whoever owns that one might want to double check that it's been fixed there too.
I will repackage a point release of my wpg2connections theme that includes this fix.
Thanks!
Pete