Copied to clipboard

Flag this post as spam?

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


  • Lars Mortensen 90 posts 98 karma points
    Jun 03, 2009 @ 23:22
    Lars Mortensen
    0

    if statement not working.

    Hi

    I have this:
    [code]
    Template:


    * The Property alias of the Media Picker is (of cause) imgPic *

    XSLT:

    ]>

    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">








    [/code]
    Running on umbraco v 4.0.0 (Assembly version: 1.0.3219.29118) Beta and is working fine.

    I the copied the xslt to a new site's xslt file, created the tab/property needed and nothing happens.

    I have tried to write some ordenary text i the if statement at it is not written on the page, but something written in the xslt outside the if statement is written on the page.

    I also tried to change "

  • Tommy Poulsen 514 posts 708 karma points
    Jun 04, 2009 @ 00:06
    Tommy Poulsen
    0

    Hi Lars,
    it sounds as if something is wrong with your imgAlias parameter. Did you spell it correctly and also add a value in your macro-call? You could try displaying the $imgAlias content outside the if.

    Tommy

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jun 04, 2009 @ 09:34
    Thomas Höhler
    0

    try

    [code]

  • Lars Mortensen 90 posts 98 karma points
    Jun 06, 2009 @ 00:16
    Lars Mortensen
    0

    Hi

    Tommy, I have copy/pasted so I hope not it is spell error. I have pasted the macro call at the top of the code section, and the macro itself underneath so you can see if I call it write.
    I have tried to write the variable outside the if with this code
    [code]



    [/code]

    I get this in the page sourcecode: "div text="StartSlut" />" so it does not output anything.
    (If I have done it right, its probably not the best way.)

    hoehler, if I try to use your code I get this error:
    [code](XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)[/code]

    I have just upgraded to version "umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657)"

    Any other thoughts?

    /Lars

  • Tommy Poulsen 514 posts 708 karma points
    Jun 08, 2009 @ 08:44
    Tommy Poulsen
    0

    Lars, are you sure you created the imgAlias parameter correctly on the macro parameters tab - and are you sure you are passing a value when using the parameter?

    Tommy

  • Lars Mortensen 90 posts 98 karma points
    Jun 08, 2009 @ 09:56
    Lars Mortensen
    0

    Ahhhhhh sorry, no I had forgot there was a parameter tab on the Marco, and did not get it the first time you tried.
    Now the response thing I made responses what it's supposed to.

    It still, however does not work, but will look into that and response back.

    Thank you for your help so far.

  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Jun 08, 2009 @ 11:01
    Warren Buckley
    0

    OK norphf I recommend to help you debug before your if is to either do

    [code][/code]
    or
    [code][/code]

    Warren :)

  • Lars Mortensen 90 posts 98 karma points
    Jun 14, 2009 @ 16:56
    Lars Mortensen
    0

    Sorry for the long reply, its working now thank you all.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies