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  |  

Maximum ASP
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Images in XSL
Previous Previous
 
Next Next
New Post 2/14/2007 8: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 9:08 AM
User is offline Stefan Cullmann
1431 posts
6th 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

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

 
New Post 2/14/2007 10: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 12:49 PM
User is offline Stefan Cullmann
1431 posts
6th 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

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

 
New Post 4/4/2007 2:58 PM
User is offline iwonder
409 posts
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.

 


Dnaxp.Net
Dnaxp.Net offers a comprehensive base of information, resources, and support for DotNetNuke.
www.dnaxp.net
DNNMasters - modules, consulting, development
DNNMasters developers are involved in DNN development since DNN 1.0.9 and today we offer a broad range of DNN related products and services including custom development of modules, help with ing third party modules for specific needs, general DNN technical support and administrative services.
www.dnnmasters.com
Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com

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