Linking to image varieties


(Warwick Barnes) #1

G'day,

 

In the WYSIWYG editor, a link to an image variety seems to be in this form:

 

src="./?a=12345:v2$"

 

It doesn't seem to make any difference if you leave the dollar sign off:

 

src="./?a=12345:v2"

 

I'd quite like to leave off the dollar sign because I'm automatically inserting these links using PHP DOM and the Matrix SOAP service. If I attempt to use a dollar sign in a link then it's encoded and I end up with:

 

src="./?a=12345:v2%24"

 

... which doesn't work at all.

 

Does anyone know the significance of the $ and whether it's necessary in some way?

 

Also, it would seem that referring to image varieties by the sequence number that they happened to be created in (v1, v2, v3, etc) leads to the possibility of broken links later if you remove and re-add some of the image varieties - even if you keep the names the same. Does anyone have any suggestions about this?

 

Thanks,

 

Warwick


(Nic Hubbard) #2

If you are using an Asset Listing, you can use %image_v_<variety_name>_url% to print the image variety URL.


(Bart Banda) #3

The requirement of the dollar sign was removed as part of a bug fix: http://bugs.matrix.squiz.net/view_bug.php?bug_id=6528

 

 

 Bug #6528: Eluding dollar sign $ after image variety link can break other links. The regular expression for the shadow asset would try to match all chars till '$' char in the bodycopy contnet, which was incorrect and would break any bodycopy content that had shadow assetid link (without '$' bit) followed by a '$' char anywhere else in the content (eg <a href='./?a=123:v1'>Image</a> Prince 0...). For fix, only allow 'a-zA-Z0-9' chars as valid chars for the shadow assetid bit (shadow assetid link that can have a URL), where '$' bit being optional and also not being part of the assetid.
This will also make it inline with the shadow asset replacement at the global level (in mysource.inc)

So it should be safe to ignore it. But like Nic said, you can just use the variety name instead. 


(Warwick Barnes) #4

Thanks Nick and Bart. Mostly we use asset listings and paint layouts to display images, but in this case we're working with old pages where the images are embedded in the hypertext and I can't do much to change this: so I'll have to use the "./?a=12345:v2" style links; but at least I know now not to worry about the dollar sign, so that's really good. (I'm about to proceed with importing over 10,000 images into Matrix, so I need to make sure my process for this is correct…)

Cheers,

Warwick