Uploaded image for project: 'Skin Intranet'
  1. Skin Intranet
  2. SKININTRA-23

[Skin intranet] Missing templates for string type fields rendering into the profile page

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1, 1.1.0

    Description

      There is no <xsl:template match="metadata[@type='string']" mode="display">, nor <xsl:template match="metadata" mode="display"> to have a correct rendering of fields with string type. 

      I copied them into my project from Ametys\skins\skin-workspaces\master\main\skin-workspace-catalog\stylesheets\content\member\member-main.xsl to get a correct rendering. Please add them to the Intranet skin.

       <xsl:template match="metadata[@type='string']" mode="display">
              <xsl:param name="name" select="@name"/>
              <xsl:param name="value" select="/view/content/metadata/*[local-name() = $name]"/>
              
              <xsl:variable name="definition" select="."/>
              <div class="ametys-content-section rs-editable rs-editable--dark rs-editable--negative-top">
                  <xsl:if test="not($value)">
                      <xsl:attribute name="style">display:none</xsl:attribute>
                      <xsl:attribute name="class">ametys-content-section rs-editable rs-editable--dark rs-editable--negative-top ametys-content-section-empty</xsl:attribute>
                  </xsl:if>
                  
                  <xsl:apply-templates select="$definition" mode="label"/>
                          
                  <xsl:choose>
                      <xsl:when test="$value">
                          <div class="ametys-richtext" data-ametys-metadata="{concat(/view/content/@id, ';', $name)}">
                              <xsl:apply-templates select="$definition" mode="value">
                                  <xsl:with-param name="value" select="$value"/>
                              </xsl:apply-templates>
                          </div>
                      </xsl:when>
                      <xsl:otherwise>
                          <div class="rs-editable__pseudo-text front-edition-placeholder" data-ametys-metadata="{concat(/view/content/@id, ';', $name)}" style="display: none; height: 100px; text-align: center">
                              <xsl:apply-templates select="$definition" mode="placeholder"/>
                          </div>
                      </xsl:otherwise>
                  </xsl:choose>
              </div>
          </xsl:template>
          
          <xsl:template match="metadata[@type='string']" mode="label">
              <h1 class="ametys-richtext-title-1 ametys-editable"><xsl:value-of select="label"/></h1>
          </xsl:template>
          
          <xsl:template match="metadata[@type='string']" mode="value">
              <xsl:param name="value"/>
              
              <p><xsl:value-of select="$value"/></p>
          </xsl:template>

       

      Attachments

        Activity

          People

            laurence Laurence Aumeunier
            llopez Laure Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: