Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Images in XSL
Previous Previous
 
Next Next
New Post 2/14/2007 9:07 AM
User is offline Juan Sebastian
2 posts
10th Ranked


Images in XSL 

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 10:08 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: Images in XSL 

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.


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 2/14/2007 11:29 AM
User is offline Juan Sebastian
2 posts
10th Ranked


Re: Images in XSL 

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 1:49 PM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: Images in XSL 
Modified By Stefan Cullmann  on 2/14/2007 4:52:20 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>

Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 4/4/2007 3:58 PM
User is offline iwonder
485 posts
wizzodawg.blogspot.com/
8th Ranked


Re: Images in XSL 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Images in XSL
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


PartnerPoint | Community of Microsoft Partners
PartnerPoint is one of the largest and most active online communities of Microsoft Partners worlwide with over 8,000 members.
www.PartnerPoint.com
Web Valley
Website design, Database development
www.webvalley.com
UK DotNetNuke CMS installation, hosting & support
UK based installation, branding, customising, integration, hosting, training, support and maintenance services for DotNetNuke
www.deburca.co.uk

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP