Menu

URL attribute and portal url error

Vasek
2024-01-04
2024-01-05
  • Vasek

    Vasek - 2024-01-04

    Hey,
    I have a little problem with the URL attribute.
    I have an extension with a field:

    <field id="catalog_sw" xsi:type="AttributeURL" _delta="define">
    <sql>catalog_sw</sql>
    <default_value>https://itop.prod.cz/itop/pages/exec.php/manage/itop-sw-overview?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal</default_value>
    <is_null_allowed>true</is_null_allowed>
    <target>_blank</target>
    </field>
    

    It's giving me an error:
    EntityRef: expecting ';'
    Specifically between the word exec_page and =index.php
    Is there any way around this?
    Thank you.

     
  • Stephen Abello

    Stephen Abello - 2024-01-04

    Hi Vasek,

    Did you try to escape the & character as &amp; ?

    Regards
    Stephen

     
    • Vasek

      Vasek - 2024-01-04

      Hey Stephen,
      What do you mean? The link is written above. It is a link that is automatically generated by itop when I create a new brick.
      https://itop.prod.cz/itop/pages/exec.php/manage/itop-sw-overview?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal

       
      • Stephen Abello

        Stephen Abello - 2024-01-04

        I understand, but in XML there's characters that you need to escape like <, > or &.
        So your attribute declaration should look either like this:

        <default_value>https://itop.prod.cz/itop/pages/exec.php/manage/itop-sw-overview?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal</default_value>
        

        or this:

        <default_value><![CDATA[https://itop.prod.cz/itop/pages/exec.php/manage/itop-sw-overview?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal]]></default_value>
        
         
        👍
        1
        • Vasek

          Vasek - 2024-01-05

          Thank you Stephen. Second XML example is perfect.

           
          ❤️
          1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.