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 ForumsForm and ListForm and ListAdding Align to Image FieldsAdding Align to Image Fields
Previous
 
Next
New Post
5/19/2009 3:40 PM
 

This is more of an XSLT question.

In my XSLT, I have:
                  <xsl:value-of select="udt:Image" disable-output-escaping="yes" />

I've tried adding:
<xsl:attribute name="align">left</xsl:attribute>
immediately aftewards.

When it attempts to render, I get:
"Error Description: Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added."

I'm not really sure what that means and how I can get the output I'm looking for.

 
New Post
5/26/2009 7:51 AM
 

Mike, udt:Image is of dataType Image?

If so, udt:Image already contains the complete html for the image. I suggest to rewrite your statement with the help of the hidden columns.

<img src="{udt:Image_UDT_Url}" alt="{udt:Image_UDT_Caption}" align="left"/>

 

 
New Post
8/1/2011 10:22 AM
 
Stefan, I am trying to something similar and running into a problem.  In effect, I am trying to use the form and list module to make it easy for novice users to edit/update records, but when displaying them, make it appear that each record is in its own collapsible container (just like other modules on the page).

To do this, I have made the following XSLT file

<?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" exclude-result-prefixes="udt">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
  <!--
  This prefix is used to generate module specific query strings
  Each querystring or form value that starts with udt_{ModuleId}_param 
  will be added as parameter starting with param
  -->
    <xsl:variable name="ModID"><xsl:value-of select="//udt:Context/udt:ModuleId" /></xsl:variable>
    <xsl:variable name="prefix">udt_<xsl:value-of select="$ModID" /></xsl:variable>
    <xsl:variable name="prefix_param"><xsl:value-of select="$prefix" />_param</xsl:variable>
    
  <xsl:template match="udt:Data" mode="list">
  
      <script language="javascript">
            function toggle(showHideDiv, switchImgTag) 
            {  
                var ele = document.getElementById(showHideDiv);
                var imageEle = document.getElementById(switchImgTag);
                if(ele.style.display == "block") 
                {
                    ele.style.display = "none";
                    imageEle.innerHTML = '<img src="/images/min.gif"/>';
                }
                else 
                {
                    ele.style.display = "block";
                    imageEle.innerHTML = '<img src="/images/max.gif"/>';
                }
            }
            </script>
              <tr class="Normal">
            <td>
                <xsl:call-template name="EditLink" />
            </td>
            <td>
                <div class="c_container c_head_c1">
                    <div class="c1_tl">
                        <div class="c1_tr">
                            <div class="c1_tm">
                                <div class="head_title">
                                    <h2 class="c_title">
                                        <xsl:value-of select="udt:Title" disable-output-escaping="yes" />
                                    </h2>
                                </div>
                                <div style="float:right;">
                                    <a id="imageDivLink" href=" toggle('contentDivImg', 'imageDivLink');"><img src="/images/min.gif" />
                                        <xsl:attribute name="href">
                                             toggle('<xsl:value-of select="$prefix"/>_<xsl:value-of select="udt:UserDefinedRowId"/>_ContentPane', 'imageDivLink');
                                        </xsl:attribute>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="c1_box">
                    <div class="c_content">
                          
                        <div id="ContentPane" runat="server" class="Normal c_contentpane">
                            <xsl:attribute name="id">
                                <xsl:value-of select="$prefix"/>_<xsl:value-of select="udt:UserDefinedRowId"/>_ContentPane 
                            </xsl:attribute>
                            <table>
                          <tr>
                              <td>
                                  <xsl:value-of select="udt:Description" disable-output-escaping="yes" />
                              </td>
                          </tr>
                          <tr>
                              <td>
                                  <b>Time:</b>
                                  <xsl:value-of select="udt:Time" disable-output-escaping="yes" />
                              </td>
                          </tr>
                          <tr>
                              <td>
                                  <b>Meeting Point:</b>
                                  <xsl:value-of select="udt:Meeting_x0020_Point" disable-output-escaping="yes" />
                              </td>
                          </tr>
                      </table>
                        </div>
                    </div>
                    <div class="c_footer">
                    </div>
                </div>
                <div class="c1_bl">
                    <div class="c1_br">
                        <div class="c1_bm"> </div>
                    </div>
                </div>
            </td>
        </tr>
  </xsl:template>
  
  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <xsl:if test="$currentData">
      <table>
        <xsl:apply-templates select="$currentData" mode="list">
        </xsl:apply-templates>
      </table>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="EditLink">
    <xsl:if test="udt:EditLink">
        <a href="{udt:EditLink}">
            <img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
        </a>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>


I know that it is not fully baked (I'm just learning this stuff) but when I apply this I get an error message stating:

XSL Tranformation failed. Switched back to Default Grid Table.
StyleSheet:/Portals/0/XslStyleSheets/CommunityTours_test.xsl
Error Description: Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added.

Which is how I found this post in the first place :-)

I know that the offending part is the following segment (found by trial error, not understanding):
<div style="float:right;">
    <a id="imageDivLink" href=" toggle('contentDivImg', 'imageDivLink');"><img src="/images/min.gif" />
        <xsl:attribute name="href">
             toggle('<xsl:value-of select="$prefix"/>_<xsl:value-of select="udt:UserDefinedRowId"/>_ContentPane', 'imageDivLink');
        </xsl:attribute>
    </a>
</div>

My issue is that I don't understand what the problem is, or how to fix it.

Is there a better way to attempt to mimic the expand/collapse behaviour of a module?

Any suggestions would be great!!
 
New Post
8/9/2011 7:11 PM
 
i figured it out. will post details when I get a moment
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListAdding Align to Image FieldsAdding Align to Image Fields


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