• Resolved masimansari

    (@masimansari)


    I hardcoded a variable “user” as a guid which is equal to logged in user. When i use the hardcoded variable the data gets just fine, however, when i try using the userlogin variable, it fails. However, it shows the same value when i print both variables.

    {% set user = “b5f6d824-c8a6-ec11-983f-00224884c115” %}
    //essentially the user_login method is getting the same guid so userlogin and user variables should be the same
    {% set userlogin = “[user_login]” %}
    {% if userlogin is same as user %}
    the variables are the same {% else %} the variables are different
    {% endif %}

    {% fetchxml collection=’communications’ cache=’PT3S’ %}<fetch mapping=’logical’ returntotalrecordcount=’true’><entity name=’ps_websitecommunication’><filter> <condition attribute=’ps_cou_contact’ operator=’eq’ value = ‘{{“#{userlogin}”}}’/></filter></entity></fetch>
    {% endfetchxml %}

    {% if communications.results.entities|length > 0 %} <table width=’100%’ border=’1′ style=’border-collapse:collapse;width=100%;table-layout:fixed’><tbody><tr style=’background-color:Green;color:white;’><th width=’25%’>Type</th><th width=’25%’>Date</th><th width=’25%’>Reference </th><th width=’25%’>Download Link</th></tr>{% for communication in communications.results.entities %} <tr><td>{{communication[‘ps_communicationtype’]}}</td><td>{{communication[‘createdon’]|date(‘d F Y’)}}</td><td>{{communication[‘cre6e_communicationreference’]}}</td><td> Click to open </td></tr>{% endfor %}</tbody></table>{% else %}<p>No communications found.</p>{% endif %}

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hardcoded variable is working but variable created from shortcode is not’ is closed to new replies.