{% if PageParameter.workflowTypeId %}
    
    <!-- get the guid of the workflowtype -->
    {% workflowtype id:'{{ PageParameter.workflowTypeId }}' %}
        {% assign workflowTypeGuid = workflowtype.Guid %}
    {% endworkflowtype %}
    
    <!-- find all the blocks that have a user entry block with a workflow selected (this may need additional paramters if you have similar custom blocks) -->
    {% attribute where:'Name *= "Workflow Type" && EntityTypeQualifierValue == 264' %}
       {% attributevalue where:'AttributeId == {{ attribute.Id }} && Value *= "{{ workflowTypeGuid }}"' %}
            {% assign itemValues = attributevalueItems %}
            {% assign itemSize = attributevalueItems | Size %}
       {% endattributevalue %}
    {% endattribute %}
    
    <!-- make sure we have values before we show the alert -->
    {% if itemSize > 0 %}
        <div class='alert alert-default'>
            This Workflow is currently being used via user entry on the following pages:<br/>
            <ul>
                <li>
                {% for attributeValue in itemValues  %}
                    {% Rock_Model_Block where:'Id == {{attributeValue.EntityId}}' %}
                        <a href='{{ 'Global' | Attribute:'InternalApplicationRoot' }}/page/{{ Rock_Model_Block.Page.Id }}' target='_blank'>{{ Rock_Model_Block.Page.BrowserTitle }}</a>
                    {% endRock_Model_Block %}
                {% endfor %}
              </li>
            </ul>
        </div>
    {% endif %}

{% endif %}