DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

DDR Menu Open in New Window

Sort:
You are not authorized to post a reply.





New Around Here





    After a lot of looking I managed to piece this together but it doesn't work.  URL's and Files still won't open in a new window using the DDR menu.  I found some documentation saying this was fixed in 7.22 - I am using 9.4.  Here is my XSLT file:

    [?xml version="1.0" encoding="UTF-8"?]
    [xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"]
         [xsl:output method="html"/]
         [xsl:template match="/*"]
              [xsl:apply-templates select="root" /]
         [/xsl:template]
         [xsl:template match="root"]
              [ul]
                   [xsl:apply-templates select="node" /]
                   
              [/ul]
         [/xsl:template]
         [xsl:template match="node"]
              [li]
                   [xsl:attribute name="class"]
                   [xsl:if test="@first = 1"]first
                [/xsl:if]
                   [xsl:if test="@last = 1"]
                        [xsl:text] [/xsl:text]last
                [/xsl:if]
                   [xsl:if test="@selected = 1"]
                        [xsl:text] [/xsl:text]selected
                   [/xsl:if]
                   [/xsl:attribute]
                   [xsl:choose]
                        [xsl:when test="@enabled = 1"]
                             [xsl:attribute name="href"][xsl:value-of select="@url"/][/xsl:attribute]
                             [xsl:choose]
                                  [xsl:when test="@target != ''"]
                                       [xsl:attribute name="target"][xsl:value-of select="@target"/][/xsl:attribute]
                                  [/xsl:when]
                                  [xsl:otherwise]
                                  [/xsl:otherwise]
                             [/xsl:choose]
                        [/xsl:when]
                        [xsl:otherwise]
                             [xsl:value-of select="@text" /]
                        [/xsl:otherwise]
                   [/xsl:choose]
                   [xsl:if test="node"]
                        [ul]
                             [xsl:apply-templates select="node" /]
                        [/ul]
                   [/xsl:if]
              [/li]
         [/xsl:template]
    [/xsl:stylesheet]

     

    Any help would be appreciated.  I did replace <> with [] to get this to post in my question only.






    Veteran Member





      Examples:

       

      < a href="{@url}" target="{@target}"> 

      < a href="{@url}"> < xsl:attribute name="class"> < xsl:text>Level< /xsl:text>< xsl:value-of select="$level" /> < xsl:text> Item< /xsl:text>< xsl:value-of select="count(preceding-sibling::node)+1"/> < xsl:if test="@selected=1"> Active< /xsl:if> < xsl:if test="@breadcrumb=1 and @selected!=1"> ActiveParent< /xsl:if> < xsl:if test="node"> HasChildren< /xsl:if> < /xsl:attribute> < xsl:attribute name="aria-haspopup"> < xsl:choose> < xsl:when test="node">true< /xsl:when> < xsl:otherwise>false< /xsl:otherwise> < /xsl:choose> < /xsl:attribute> < xsl:choose> < xsl:when test="@icon !=''"> < img src="{@icon}" title="{@title}" /> < /xsl:when> < /xsl:choose> < xsl:choose> < xsl:when test="@target != ''"> < xsl:attribute name="target"> < xsl:value-of select="@target"/> < /xsl:attribute> < /xsl:when> < /xsl:choose> < span>< xsl:value-of select="@text" />< /span> < /a>

      That second one seems the same as you have. I think the issue is that you are adding the target to the LI not an A?






      Veteran Member





        You can find (and download) some working DDR demo skins here: https://demo.40fingers.net/dnn-ddr-demo-skin






        Veteran Member





          As a general tool, you can use the browser developer tools to look at the html that's actually rendered by the template. You'll find that quite useful for a number of things.
          Joe Craig
          DNN MVP
          Patapsco Research Group
          You are not authorized to post a reply.

          These Forums are dedicated to the discussion of DNN Platform.

          For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

          1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
          2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
          3. 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.
          4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
          5. No Flaming or Trolling.
          6. No Profanity, Racism, or Prejudice.
          7. Site Moderators have the final word on approving / removing a thread or post or comment.
          8. English language posting only, please.

          Would you like to help us?

          Awesome! Simply post in the forums using the link below and we'll get you started.

          Get Involved