Link type field target

View: New views
2 Messages — Rating Filter:   Alert me  

Link type field target

by Lou Parisi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a link type field and I am trying to create a custom stylesheet to display the link in a table layout.  From the default document-to-html.xsl and from other posts it looks like this should work:

      <tr>
         <xsl:variable name="fieldLink" select="d:fields/d:field[@name='PRODUCT_SITE_LINK']/@target"/>
         <xsl:variable name="fieldText" select="d:fields/d:field[@name='PRODUCT_SITE_LINK']/@valueFormatted"/>
         <td align="right">Product Site Link:</td>
         <td align="left"><xsl:value-of select="$fieldText" /></td>
      </tr>

I get the correct document name for @valueFormatted but the @target comes back empty.  I created the field in the daisy editor and I can open the link from the editor using the follow link button in the editor.

Any ideas why I am not getting a value back for the fieldLink?

Re: Link type field target

by Karel Vervaeke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The @target attribute belongs to d:link, not to d:field.

In short, replace
d:fields/d:field[@name='PRODUCT_SITE_LINK']/@target
with
d:fields/d:field[@name='PRODUCT_SITE_LINK']/d:link/@target

Whenever you encounter this kind of problems, try using this recipe:

<textarea><xsl:copy-of select="."/></textarea>

(Change the @select to inspect whatever you want.)

mvg,
Karel

On Thu, Sep 10, 2009 at 1:14 AM, Lou Parisi <Lou.Parisi@...> wrote:

>
> I have a link type field and I am trying to create a custom stylesheet to
> display the link in a table layout.  From the default document-to-html.xsl
> and from other posts it looks like this should work:
>
>      <tr>
>         <xsl:variable name="fieldLink"
> select="d:fields/d:field[@name='PRODUCT_SITE_LINK']/@target"/>
>         <xsl:variable name="fieldText"
> select="d:fields/d:field[@name='PRODUCT_SITE_LINK']/@valueFormatted"/>
>         <td align="right">Product Site Link:</td>
>         <td align="left"> {$fieldLink} <xsl:value-of select="$fieldText" />
> </td>
>      </tr>
>
> I get the correct document name for @valueFormatted but the @target comes
> back empty.  I created the field in the daisy editor and I can open the link
> from the editor using the follow link button in the editor.
>
> Any ideas why I am not getting a value back for the fieldLink?
> --
> View this message in context: http://www.nabble.com/Link-type-field-target-tp25374716p25374716.html
> Sent from the Daisy - General mailing list archive at Nabble.com.
>
> _______________________________________________
> daisy community mailing list
> Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
> mail to: daisy@...
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
>
_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy