Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • vaibhav 119 posts 139 karma points
    May 16, 2011 @ 08:15
    vaibhav
    0

    Changing parameter names using xslt

    Hi,

    I have createdd parameters in my document type.

    Is it possible to change the name of the parameters according to some conditions ?

    Like ....i have one drop down box ...i have 2 values in it ..say ....Solutions & products...

    If i select the solutions then some parametes should be disabled & some have to change there name(i dont want to change Alias)....Is it possible to do spmething like this using xslt ?....

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 16, 2011 @ 08:32
    Dirk De Grave
    0

    Can you elaborate and give an example of what you're trying to do?

     

    Cheers,

    /Dirk

  • vaibhav 119 posts 139 karma points
    May 16, 2011 @ 09:32
    vaibhav
    0

    Lets say .....i have two templates ...one is solutions which has header,sub header & content in it & other is products which has only header & content in it.

    I want to give user to choose any of the templates using dropdown box (i have done this & its working properly).

    Now i have created parameters such as header,sub header & content....

    When user selects solutions then all three parameters should be enabled as this template has all these parameters but when user selects products then parameter named sub header should be disabled ...i want to do thid using xslt.....hope u can understand what i want to do ......

    In same way can change the name of the parameter according to condition in dropdown box using xslt

  • vaibhav 119 posts 139 karma points
    May 17, 2011 @ 07:38
    vaibhav
    0

    There is no one who can help me in this ?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 17, 2011 @ 07:51
    Chriztian Steinmeier
    1

    Hi vaibhav,

    It's still a bit unclear to me if you're somehow replicating the built-in Template functionality of Umbraco or if that's not at all what you're trying.

    Here's kind of a solution using a property named customTemplate which you can define multiple values for (what you already did, probably) and use those values to decide what gets rendered to the page. The example uses the same Document Type for both versions, which is what I think you're doing:

       <xsl:template match="/">
            <xsl:apply-templates select="$currentPage" />
        </xsl:template>
    
        <xsl:template match="Textpage[customTemplate = 'solutions']">
            <div class="solutions">
                <h1><xsl:apply-templates select="header" /></h1>
                <h2><xsl:apply-templates select="subheader" /></h2>
                <div>
                    <xsl:apply-templates select="content" disable-output-escaping="yes" />
                </div>
            </div>
        </xsl:template>
    
        <xsl:template match="Textpage[customTemplate = 'products']">
            <div class="products">
                <h1><xsl:apply-templates select="header" /></h1>
                <xsl:apply-templates select="content" disable-output-escaping="yes" />        
            </div>
        </xsl:template>
    

    /Chriztian

  • vaibhav 119 posts 139 karma points
    May 17, 2011 @ 13:58
    vaibhav
    0

    That i have done ....

    header,subheader & content are properties of the document type......that will be seen to the webmaster who will write some content in from the umbraco editor.....

    i want that if web master choose products then subheader property should be disabled as i dont want it for products & web master should only can write on header & content .....

     

    hope u understand...

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 17, 2011 @ 14:09
    Chriztian Steinmeier
    0

    Hi vaibhav,

    You should really use the built-in power of Document Types in Umbraco - just create them as two different document types, and then your webmaster can choose whichever he wants when creating new content.

    /Chriztian

  • vaibhav 119 posts 139 karma points
    May 18, 2011 @ 09:30
    vaibhav
    0

    I have to give this opetion in one document type only..

    Can we disable thet property if we dont want ?....

    If yes then please give some demo code for that....

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 18, 2011 @ 22:39
    Chriztian Steinmeier
    0

    To answer your question - no, it's not possible to hide a property like that (atleast not without some kind of special handler, of which I know nothing how to code)

    /Chriztian

  • vaibhav 119 posts 139 karma points
    May 19, 2011 @ 10:35
    vaibhav
    0

    ok,

    I think its not possible to change the properties like mandatory,description of the generic properties using xslt .

     

    Thanx for your help ...

Please Sign in or register to post replies

Write your reply to:

Draft