Announcement

Collapse
No announcement yet.

Block test for Section Name containing special characters

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

    Block test for Section Name containing special characters

    I want to create a block test that tests the section name. The section name though contains & and - in many cases. With these characters a test such as this:
    Code:
    <actinic:variable name="SectionName" selectable="false"/> !="words to test & work - try them"
    does not work.

    The test code is actually php so does anyone know how I can include these characters in the test string?
    I've tried all manner of methods without any luck.

    #2
    Use encoding="perl" selectable="false" and enclose the variable in single quotes.

    E.g.
    Code:
    <actinic:block php="true">
      $test = '<actinic:variable name="SectionName" encoding="perl" selectable="false"/>' != 'words to test & work - try them';
    </actinic:block>
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Many thanks for that Norman.

      By adding selectable false and ecoding perl to the section name variable inside the Blockif condition it now works correctly. I thought that any standard Actinic variables used inside Blockif conditions were treated as if they had selectable false and ecoding perl but obviously not.

      Full test is below if anyone wants to see it:
      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionName%22%20encoding%3d%22perl%22%20selectable%3d%22false%22%2f%3e%20%21%3d%22words%20to%20test%20%26%20work%20%2d%20try%20them%22" >
      
      <actinic:variable name="SectionLink" />
      
      </actinic:block>

      Comment

      Working...
      X