Technical support This forum is closed.
Version 1.x > Technical support > BUG: Images in 1.6 are not relative View modes: 
User avatar
Member
Member
cpaul - 5/10/2005 9:20:44 PM
   
BUG: Images in 1.6 are not relative
For a site being developed as http://localhost/www, I added a new image document:

/Products/Foo/Foo_Polaroid.jpg and selected it as an image in my template.

The produced URL for the image is /Products/.... and not /www/Products. Since the only place I could fix this would be in the xslt I can't really call a ResolveUrl, so it seems that Kentico should take into account the application root when rendering images.

Also, it is a bit cumbersome and unintiutive to go to View->Select this document when choosing an image. Perhaps a new button could be added to the toolbar when in "search for image mode" that selects the image.

User avatar
Member
Member
wtijsma - 5/11/2005 9:59:20 AM
   
Re: BUG: Images in 1.6 are not relative
Hi,

I have written some code that allows you to use custom XsltExtensions, also make calls to ResolveUrl and some other functions. It requires 2 extra lines in the Kentico.CMS.ContentEngine.dll code, if I'm allowed by Petr I can send you a modified assembly and my code. (unless you have the src code version, that would be easier)

User avatar
Member
Member
cpaul - 5/11/2005 4:55:34 PM
   
Re: BUG: Images in 1.6 are not relative
I now have the src code version.

User avatar
Guest
admin - 5/12/2005 10:24:40 AM
   
Re: BUG: Images in 1.6 are not relative
Hi Wiebe,

Thank you for your post. You can provide the code to Chip as he already has the source code version, too. I hope we will manage to add it to our code soon as well.

Thank you very much.

Best Regards,

User avatar
Member
Member
wtijsma - 5/12/2005 10:37:03 AM
   
Re: BUG: Images in 1.6 are not relative
OK...

Chip, you can download and add this project to your solution:
http://www.netindustry.nl/resources/xsltextensions/default.aspx?lang=en

follow instructions there to enable it.

Afterwards, take these steps:
- Add a reference to Vitsol.XsltExtensions

add these lines to the Kentico.CMS.Contentengine/ContentProvider.cs in the Transform() method, right before the transformation:

// Get the settings for the XsltExtensionFactory section
XsltArgumentList argumentList = new XsltArgumentList();
XsltExtensionFactory factory = new XsltExtensionFactory();
factory.AddObjectsTo(argumentList);

and replace this:

xslTransform.Transform(xslDoc, null, resultSW, null);

with this:

xslTransform.Transform(xslDoc, argumentList, resultSW, null);


User avatar
Guest
admin - 5/12/2005 10:23:40 AM
   
Re: BUG: Images in 1.6 are not relative
Hi Chip,

Generally, you can use the ~/Products/... syntax in XSLT transformations - the HREF and SRC attributes are then processed by the CMSViewer control and ResolveUrl method is applied to them.

I'd like to recommend you developing the web site in a root of a web site. You can use the utility from http://www.mindxpand.be/iisadmin to create and manage multiple web sites on Windows XP.

Regarding the issue with "View -> Select" - it will be fixed in the nearest update - the View mode will be selected automatically.

Thank you.

Best Regards,