# Conditional Statement on Blog Listing page

**URL:** <https://community.hubspot.com/t/conditional-statement-on-blog-listing-page/7391>\
**Category:** CMS Development\
**Created:** [January 24, 2018, 10:51am UTC](https://community.hubspot.com/t/conditional-statement-on-blog-listing-page/7391 "2018-01-24T10:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [January 24, 2018, 10:51am UTC](https://community.hubspot.com/t/conditional-statement-on-blog-listing-page/7391/1 "2018-01-24T10:51:00Z")

</div>

I am trying to render a custom module \*\*bleep\*\* if it has been set

Here is the custom module markup on the listing page

`{% text "resource-url" label='Resource URL', **bleep** ='', export_to_template_context=True %}`

and here is my conditional code for the blog listing, is == ’ ’ a correct way to check?

```auto
{% set rec_posts = blog_recent_posts('default', 4) %}<div class="featured-posts">{% for rec_post in rec_posts %}{% if rec_post.widgets.resource-url.body. **bleep** == '' %}
<div class="post-title"><h2><a href="{{ rec_post.absolute_url }}">{{ rec_post.name|truncate(37,true,'...') }}</a></h2></div>
 {% elif rec_post.widgets.resource-url.body. **bleep**!= '' %}
<div class="post-title"><h2><a href="{{ rec_post.widgets.resource-url.body. **bleep** }}">{{ rec_post.name|truncate(37,true,'...') }}</a></h2></div>
 {% else %}
<div class="post-title"><h2><a href="{{ rec_post.absolute_url }}">{{ rec_post.name|truncate(37,true,'...') }}</a></h2></div>
 {% endif %}

```

Currently the absolute\_url is the \*\*bleep\*\* everytime

---

<div class="post-metadata">

**Author:** ![anders\_grove](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anders_grove/32/99626_2.png) [@anders\_grove](https://community.hubspot.com/u/anders_grove)\
**Post date:** [January 26, 2018, 7:45am UTC](https://community.hubspot.com/t/conditional-statement-on-blog-listing-page/7391/2 "2018-01-26T07:45:57Z")

</div>

```auto
{% text "resource_url" label='Resource URL', **bleep** ='', export_to_template_context=True %}

{% if widget_data.resource_url. **bleep** %}
 <!--True-->
 <p>The custom widget has a **bleep** </p>
{% else %}
 <!--False-->
 <p>The custom widget doesn't have a **bleep** </p>
{% endif %}

```

---

<div class="post-metadata">

**Author:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [January 30, 2018, 8:36am UTC](https://community.hubspot.com/t/conditional-statement-on-blog-listing-page/7391/3 "2018-01-30T08:36:30Z")

</div>

Ahh thank you, it was the name of my variable!
