Announcement

Collapse
No announcement yet.

Correct Syntax for <if> <else> </if> please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Correct Syntax for <if> <else> </if> please

    Hi All

    I am having a little trouble with the <else> syntax on something I am trying to do. Can someone please clarify the correct syntax for me please.

    I want to put the alt text for an image if condition #1 and something else if not condition #1 and have tried

    <if condition="condition #1'">
    alt="this text"
    </else>
    alt="this alternative text"
    </if>

    but that doesn't seem to work...!!

    Can someone please correct my <else> syntax. Many thanks..
    John

  • #2
    <else /> instead of </else>



    The tags follow XHTML standards.

    All tags must open and close, a tag that does not end with an ending tag ends itself with / at the end

    for example

    <div> </div>

    and

    <img />

    Comment


    • #3
      Bloody heck Zach... 2 mins for this support.... vB should get their act together eh!!!!

      hehehe

      Nice one matey.. .cheers...
      John

      Comment


      • #4
        OK, next stage for me now... I'd like to elaborate on the actual conditional.

        How would I check for a certain fieldID being empty...? ie:

        <if condition="$thisfield == 'empty'">
        John

        Comment


        • #5
          <if condition="$thisvar">true<else /> not true</if>
          reverse it

          <if condition="!$thisvar">not true<else />true</if>

          Comment


          • #6
            Hmmmm.... thanks again for being so prompt Zach, but I am still somewhat confuzzled here.

            How do I then check for say $fieldID to be equal to nothing? I don't understand where or what $thisvar has to do with a field value?

            Would it be...

            <if condition="$fieldID">true<else />not true</if>
            John

            Comment


            • #7
              I used $thisvar as an example. you can use it as anything you want

              <if condition="!$fieldID">

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X