# If then struct needed for filtered posts view.

**URL:** <https://community.hubspot.com/t/if-then-struct-needed-for-filtered-posts-view/48390>\
**Category:** CMS Development\
**Created:** [December 10, 2021, 10:13pm UTC](https://community.hubspot.com/t/if-then-struct-needed-for-filtered-posts-view/48390 "2021-12-10T22:13:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CMcClellan8](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cmcclellan8/32/64675_2.png) [@CMcClellan8](https://community.hubspot.com/u/CMcClellan8)\
**Post date:** [December 10, 2021, 10:13pm UTC](https://community.hubspot.com/t/if-then-struct-needed-for-filtered-posts-view/48390/1 "2021-12-10T22:13:08Z")

</div>

Hello,

I’ve been searching for a solution to detect when the view state is in the filtered posts (topics) view. I have not found is\_topic\_view or anything close.

The scenario is, I need to wrap an if/then around some custom modules to remove them from this view. One thought was to use a search on the URL for /topic/ but am not sure how to build that and the if/then around it within hubl.

Any ideas?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 14, 2021, 7:05pm UTC](https://community.hubspot.com/t/if-then-struct-needed-for-filtered-posts-view/48390/2 "2021-12-14T19:05:05Z")

</div>

@stefen probably has some ideas on how to help you out here 😉

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [December 14, 2021, 7:22pm UTC](https://community.hubspot.com/t/if-then-struct-needed-for-filtered-posts-view/48390/3 "2021-12-14T19:22:05Z")

</div>

@CMcClellan8 you should be able to use the variable `topic` with a blog listing template e.g.:

```lia-code-sample
{% if topic %}
I'm a topic page!
{% endif %}

```
