Visualizer Templates: Conditional operations using if/else


In this article, we will manipulate a visualizer using conditional statements that will serve as a working sample for template designers. 


Create a list Visualizer template where the items in the list contain a dynamic redirection (<a HREF=> ) to a document, URL or detail-page depending on which one is available. 


  • DNN Evoq Version: 9.+
  • Create a content item with four items correctly associated with content-name(s)
    • Title as single line text
    • LinktoDocument as Document 
    • LintoWebpage as URL
    • Description as multiline text (for item details page) 


  • Check if there is a valid linktoDocument
    • If yes, print out link associated with the document
    • If not, check if we have a valid linktowebpage
      • If yes, print out link associated to the page
      • If not, print out contentDetailsUrl for details page. (It will take the user to the details page associated with the content item)

Source code 

{% if linktoDocument != empty %}
<a href="{{linktoDocument | documents_url}}">{{title}}</a>
{% elseif linktowebpage != empty %}
<a href="{{linktowebpage}}">{{title}}</a>
{% else %}
<a href="{{contentDetailsUrl}}">{{title}}</a>
{% endif %}

Related articles 

Content Author

Hamid Waqas



1 comment

  • Avatar
    Craig Bauer

    I found that you need to use null rather than empty.

    {% if linktoDocument != null %}
    Comment actions Permalink

Please sign in to leave a comment.