Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLImages in XSLImages in XSL
Previous
 
Next
New Post
2/14/2007 12:07 PM
 

Hi I have a problem with XML/XSL Module version 3.03

I have an XML well formed and a XSL in the respectives folders in the root of the portal.

the conversion works fine but the problem is when i tried to show an Image. The code for the XSL:

-<table cellpadding="0" cellspacing="0" border="0" width="560">
 -<xsl:for-each select="Empresa/Servicios/Servicio">
  -<tr>
   -<td>
    -<img src="Images/btnFlecha.jpg"  border="0" width="10" height="10"/>
   -</td>
   -<td width="560">
    -<div>
     -<xsl:value-of select="."/>
    -</div>
   -</td>
  -</tr>
 -</xsl:for-each>
-</table>

I don´t get the image working but when i use TEXT/HTML module the IMG tag

-<img src="Images/btnFlecha.jpg"  border="0" width="10" height="10"/>

works fine. Can some body help me???

the place for the image is in the root for the portal in a folder Images. Example Portals/0/Images/btnFlecha.jpg

 
New Post
2/14/2007 1:08 PM
 

Your above stylesheet will always render the src="Images/btnFlecha.jpeg", it is not aware of the current path inside the dnn portal. I am surprised that the text/html module parses the input on the fly and correct it, I would not have expected this behaviour.

I recommend that you add an xsl parameter named "PortalId" with the value/data origin "Portal id" inside the settings of the xsl module. Inside your XSL script, add a <xsl:param name="PortalId">. It will be set with the value of the current Portal, so you can set your image src to  "Portals/{$PortalId}/Images/btnFlecha.jpg". The next release will also introduce "homeDirectory" as a possible parameter source to detect the current path to the portal if not installed inside the root.

PS: I've done a look at the source of the html module. It parses the content with a function ManageUploadDirectory and turns the "wrong" paths to absoulte paths respecting the current portal. I am not aware of any other module, even while using the RTE control is providing such a level of comfort.

 
New Post
2/14/2007 2:29 PM
 

Thanks for your help. I apreciate that

I have done what you tell me and the thing is that not work. My portal is in the root and it´s number 0. Inside that number i made a folder named IMAGES for the images inside the site.

How can i know which is the default path that the module has? Maybe is in the \DesktopModules\XML and the XSL is looking the folder Images inside that path. But i did that and still not working.

The thing is to know which path it is using

I have made others projects with XML and XSL and when i use path for images inside the XSL i always know that the src is establish in the root of the whole site. so i just use a folder Images and the the name of the image i need ex: Images/btnFlecha.jpg 

 
New Post
2/14/2007 4:49 PM
 

Juan Sebastian,

The XML module ignores totally any existing context, it loads your data and your stylesheet and transform the result. It is not aware of any images, and there is no need to. It just renders an html result which will included into the response stream of the current page. And, if your current page is somesting like /some/page/name/tabid/4711/default.aspx and your image path inside src is /images/somepicture.gif, your browser is going to search the image under the path  /some/page/name/tabid/4711/images/somepicture.gif.

Therefore you need to work with absoulte paths! But try again:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name ="PortalId"/>
  <xsl:template match="/">
    <img src="/Portals/{$PortalId}/Images/btnFlecha.jpg"/>
  </xsl:template>
</xsl:stylesheet>
 
New Post
4/4/2007 5:58 PM
 

Just FYI - Never did get that to work for me, but...

I added another parameter to the module settings called MyAlias
set the value to the url of my site alias: http://localhost/mysite/portals/

Then, added the parameter to the xsl

<xsl:param name ="MyAlias"/>

Then, when I referenced an img src coded it like this:

   <img src="{$MyAlias}{$PortalId}/MyImage.jpg" border="0" width="254" height="34" alt="MyImage" />

That worked for me, though a bit kludgy. 

Rather, than go through all that fuss a bother for my local xml stuff, I include the imgURL attribute in the xml file with the text like this:

<imgURL>http://localhost/MySite/portals/0/MyImage.jpg</imgURL>

Then, I'm done with it.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLImages in XSLImages in XSL


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out