Bug with is_logged detection?

I’m having an issue with hiding edit and delete buttons on the detail layout of my custom module. This is my code:
{% if is_logged == true %}
{% if this.CreatedByMemberId == request.currentmember.id %}

    <a data-fancybox data-src="#popupDelete" href="javascript:;" class="btn btn-secondary" >Delete</a>
{% endif %}
  {% endif %}   
    <a href="/suppliers/find-a-supplier" class="btn btn-primary"> Back to Suppliers List</a>

I originally didn’t have {% if is_logged == true %} but found that if the custom module item wasn’t allocated to anyone the edit delete buttons showed to the general public (because both were 0). So I added the if is_logged but now I’m logged in and I’m the content owner but I still can’t see the buttons.

Any help appreciated.

It needs to be:

{% if request.is_logged == true %}

is_logged is part of the request object.

1 Like

thanks Adam - Still not fixing the problem. I can’t get the buttons to display. I’ve checked the page detail and the data fields should be showing them. I’ll check with support

It just got fixed. Must have been a server issue.

1 Like