1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 xen:set and special characters

Discussion in 'Styling and Customization Questions' started by Gossamer, Jan 16, 2014.

  1. Gossamer

    Gossamer Active Member

    Hello! I'm trying to do a template modification that effectively loops through specific users in order of their user title and then their username. Each time the loop encounters a new user title, it uses that as a header.

    However, special characters don't seem to be coming through properly.

    For example, an apostrophe comes through as 's

    Here is my template code. It includes "Last Canon" and "This Canon" for testing methods.
    HTML:
    <xen:foreach loop="$users" value="$user">
            <xen:if is="{$LastCanon}!={$user.custom_title}">
                <h2 class="subHeading">{$user.custom_title}</h2>
            </xen:if>
            Last Canon: {$LastCanon}<br>
            This Canon: {$user.custom_title}<br>
            <a href="{xen:link members, $user}" class="username">{$user.username}</a><br>
            <xen:set var="$LastCanon">{$user.custom_title}</xen:set>
          
            </xen:foreach>
    And this is what currently outputs:
    It looks like the special characters don't encode properly when going through xen:set. Is there a better way to approach this or a workaround?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Try using:
    Code:
    {xen:raw $user.custom_title}
     

Share This Page