DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Visualizer Template - If Statement Only Working in Test

You are not authorized to post a reply.

New Around Here


    In the comments below is my visualizer template. Everything works perfectly on the test site, and everything except the {% if imageURL !='' %} statement works perfectly on production. The content type configuration is identical.

    imageURL is a new field I added because the assets field duplicates images on the server when uploaded, so I want to use the URL of the image instead, but don't want to break all the images currently being used by the assets field. If I have an image URL, I want to use that; if I don't, I want to use assets.

    On production, only the first statement is being recognized. So, when configured as below, only the imageURL field is used. If I reverse the statement, only the assets field is used.

    Again, it works fine on test when configured as below and all configuration on production (as far as I can tell) is the same. Any ideas what might be happening?


    New Around Here

      <div class="content-block-with-side-image" role="article">
                  <div class="{% if positionofimage contains 'Image to the left' %} rightpane {% else %} leftpane {% endif %} {% if contentAlignment contains 'Vertical Centered' %} v-center {% else %}  {% endif %}"  role="presentation"> 
                  <div class="content" role="presentation">
                      <h3 class="title {{contentSlug}}">{{title}}</h3>
                      {% if buttonLink !='' %}
                      <a class="btn btn-primary mt-3" href="{{buttonLink}}">{{buttonText}}</a>
                      {% endif %}
                  <div class="image {% if positionofimage contains 'Image to the left' %} leftpane {% else %} rightpane {% endif %}" role="presentation">    
                  {% if imageURL !='' %}
                  <img src="{{imageURL}}?format=jpg&quality=80" alt="{{title}}" />
                  {% else %}
                  <img src="{{assets | images_url }}?format=jpg&quality=80" alt="" />
                  {% endif %}

      You are not authorized to post a reply.

      These Forums are dedicated to the discussion of DNN Platform.

      For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

      1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
      2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
      3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
      4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
      5. No Flaming or Trolling.
      6. No Profanity, Racism, or Prejudice.
      7. Site Moderators have the final word on approving / removing a thread or post or comment.
      8. English language posting only, please.

      Would you like to help us?

      Awesome! Simply post in the forums using the link below and we'll get you started.

      Get Involved