You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Sarah Gargett <sa...@ymogen.net> on 2005/06/09 15:02:03 UTC

link to an asset - opening in a new window?

Hi,

Can anyone tell me how to insert (or create a link to) an asset so that
it opens in a new window?

I have uploaded a PDF file using the asset upload function, and I am
able to then insert the asset into my page using the asset (scroll)
button in BXE, and save the page.  However when I click on the link that
is created the PDF is opened in the existing window, and I would like it
to open in a new window.

Any suggestions?

Many thanks,
-Sarah


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: link to an asset - opening in a new window?

Posted by Doug Chestnut <dh...@virginia.edu>.
Hi Sarah,
If you are not expecting to be xhtml strict compliant you could edit 
pubs/default/xslt/xhtml2xhtml.xsl.

Change this block:

  <xsl:template match="lenya:asset">
    <xsl:variable name="extent">
      <xsl:value-of select="@size"/>
    </xsl:variable>
    <xsl:variable name="suffix">
      <xsl:call-template name="substring-after-last">
        <xsl:with-param name="input" select="@src"/>
        <xsl:with-param name="substr">.</xsl:with-param>
      </xsl:call-template>
    </xsl:variable>
    <div class="asset">
        <xsl:text>&#160;</xsl:text>
        <a href="{$nodeid}/{@src}">
          <xsl:value-of select="text()"/>
        </a>
        (<xsl:value-of select="number($extent)"/>KB)
    </div>
  </xsl:template>


To this:

  <xsl:template match="lenya:asset">
    <xsl:variable name="extent">
      <xsl:value-of select="@size"/>
    </xsl:variable>
    <xsl:variable name="suffix">
      <xsl:call-template name="substring-after-last">
        <xsl:with-param name="input" select="@src"/>
        <xsl:with-param name="substr">.</xsl:with-param>
      </xsl:call-template>
    </xsl:variable>
    <div class="asset">
        <xsl:text>&#160;</xsl:text>
        <a href="{$nodeid}/{@src}" target="_blank">
          <xsl:value-of select="text()"/>
        </a>
        (<xsl:value-of select="number($extent)"/>KB)
    </div>
  </xsl:template>


Hope this helps,
--Doug

Sarah Gargett wrote:
> Hi,
> 
> Can anyone tell me how to insert (or create a link to) an asset so that
> it opens in a new window?
> 
> I have uploaded a PDF file using the asset upload function, and I am
> able to then insert the asset into my page using the asset (scroll)
> button in BXE, and save the page.  However when I click on the link that
> is created the PDF is opened in the existing window, and I would like it
> to open in a new window.
> 
> Any suggestions?
> 
> Many thanks,
> -Sarah
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org