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

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  User Defined Ta...  Directory Listing Help
Previous Previous
 
Next Next
New Post 5/18/2008 7:29 PM
Unresolved
User is offline Crawbot
1 posts
10th Ranked


Directory Listing Help 

I'm fairly new to the DNN world and have started a reunion site for my 20th year this summer.  Inside it, I created a directory with the following fields:

Field Name - Field Type
Current Picture - Image
Name (1988) - Text
Name (2008) - Text
Bio - Rich Text
Milltary - True/False
External Personal Site - URL

Here's the style sheet I'm using to display the list.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:udt="DotNetNuke/UserDefinedTable">
<xsl:output method="xml" version="1.0"  indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/udt:UserDefinedTable">
<xsl:variable name ="imgColumn" select="//udt:Fields[udt:FieldType='Image'][1]/udt:ValueColumn"/>
<xsl:variable name ="titleColumn" select="//udt:Fields[udt:FieldType='String'][1]/udt:ValueColumn"/>
<xsl:variable name ="htmlColumn" select="//udt:Fields[udt:FieldType='TextHtml'][1]/udt:ValueColumn"/>

 <table cellspacing="0" cellpadding="4"  border="0"  style="border-width:0px;border-collapse:collapse;">
 <xsl:for-each select="udt:Data">
 <xsl:variable name="id" select="udt:UserDefinedRowId"/>
  <tr class="normal">
   <td valign="top" style="border-bottom: silver 1px solid;">
    <xsl:if test="udt:EditLink">
     <a>
      <xsl:attribute name="href">
       <xsl:value-of select="udt:EditLink" />
      </xsl:attribute>
      <img border="0" alt="edit">
       <xsl:attribute name="src">
        <xsl:value-of select="//udt:Context/udt:ApplicationPath"/>/images/edit.gif</xsl:attribute>
      </img>
     </a>
    </xsl:if>
   </td>
   <td valign="top" style="border-bottom: silver 1px solid;;"><a href="" target="_blank" >
    <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$imgColumn]" disable-output-escaping="yes"/></a>
   </td>
   <td style="border-bottom: silver 1px solid;">
    <h2><xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$titleColumn]" disable-output-escaping="yes"/></h2>
    <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$htmlColumn]" disable-output-escaping="yes"/>
    <table cellspacing="0" cellpadding="0" border="0">
     <xsl:for-each select="//udt:Fields">   
      <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn"/>
      <xsl:variable name="CurrentValue" select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$NameOfValueColumn]"/>
      <xsl:if test ="$CurrentValue and $CurrentValue!='' and ($NameOfValueColumn!=$imgColumn or not($imgColumn)) and ($NameOfValueColumn!=$titleColumn  or not($titleColumn)) and ($NameOfValueColumn!=$htmlColumn  or not($htmlColumn))and (udt:Visible='true' or udt:Visible='True')" >
       <tr class="normal">
        <td>
         <xsl:value-of select ="udt:FieldTitle"/>:
        </td>
        <td>&#160;</td>
        <td>
         <xsl:value-of select="$CurrentValue" disable-output-escaping="yes"/>  
        </td>
       </tr>
      </xsl:if>
     </xsl:for-each>
    </table>
   </td>
  </tr>
 </xsl:for-each>
 </table>
</xsl:template>
</xsl:stylesheet>

This is probably pretty standard.  However, I have the following problems with the view:

1) I want to sort the list by the "Name (1988)" field in alphabetical ascending order
2) I want the  "Current Picture" field to have a link on it to view the full picture in a pop-up window.  It currently shows a 100px thumbnail next to the record.  The thumbnail should be clicked to see the full image.

XSL is pretty foreign to me at the moment and any help would be appreciated.  Thanks in advance.

As a side curiosity, how does the list pull data?  I can't find a stored proc in the db or view to pull from.  What SQL statement could I use to generate my own dataset from the "Directory" custom udt module?

 
New Post 5/19/2008 3:39 AM
User is offline Sebastian Leupold
14295 posts
www.deutschnetnuke.de
1st Ranked












Re: Directory Listing Help 
Modified By Sebastian Leupold  on 5/19/2008 6:39:43 AM)
  1. did you check the "sorting" option in the XSL genererator?
  2. this is not built in, you will need to create a link manually in your custom XSL, I suggest to do it in the HTML editor before generating the XSL, using UDT_[coumnname]_URL hidden column. Please check out the module manual for details.

Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 5/19/2008 10:38 AM
User is offline Mike Riley
223 posts
9th Ranked


Re: Directory Listing Help 

First:  Pick up a copy of XSLT for Dummies.  The examples will definitely help out.

Second:  Use the UDT's XSL Generator to create examples to help you out.

Like Sebastian said, when you create your XSL template, you can expand the Options and add sorting support.  This will then sort by the column (and direction) specified in the Manage Table options.

  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <table>
      <xsl:apply-templates select="$currentData" mode="list">
        <xsl:sort select="*[name()=$orderBy]" order="{$orderDirection}" data-type="{$orderType}" />
      </xsl:apply-templates>
    </table>
  </xsl:template>

If you want to only specify the sorting in the XSL, you can adjust the select=, order= and data-type=.  You can also add additional xsl:sort tags to sort by more than one field.

If ALL of the pictures will be uploaded to your site, you can use  <a href="http://www.mysite.com/portals/##/[Current Picture_UDT_Original]" target="_blank">[Current Picture]</a> in the template.  The ## is the number of the portal, which you can get from Admin, Site Settings, Advanced.

If some of the pictures will be referenced from other sites, you'd need to create an xsl:choose statement and check whether the image original location includes a full path (which would be a bit more work).

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  User Defined Ta...  Directory Listing Help
 


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