# A component for Conditional UI elements?

**URL:** <https://meta.discourse.org/t/a-component-for-conditional-ui-elements/110255>\
**Category:** Development\
**Created:** [February 27, 2019, 5:19pm UTC](https://meta.discourse.org/t/a-component-for-conditional-ui-elements/110255 "2019-02-27T17:19:18Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![elbarto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elbarto/32/220286_2.png) [@elbarto](https://meta.discourse.org/u/elbarto)\
**Post date:** [May 19, 2021, 1:52am UTC](https://meta.discourse.org/t/a-component-for-conditional-ui-elements/110255/6 "2021-05-19T01:52:10Z")

</div>

In general i have some elements that i need to show in homepage, like a any web page have a video demo, welcome text, suscribe form, pictures.  
Theese content i dont need to show in my other sections (eg categories, threads, etc), because there are in the home page only.  
I tryed to make this effect with JS but when i save my code on the “after header” that doesnt run scripts. Only run in “\</ body\>” and “\</ hader\>” elements and its impossible to change the order in the html.  
For example, if i try to make this structure, its impossible:

- header
- search
- video (only in the home)
- threads
- recomendations (only in home)
- footer

I think that Discourse use a normal webpage in a home path domain and then use the forums in a subdomain, but it would be great to be able to customize content blocks according to the page, and use only Discourse for the entire site.

Sorry about my english 😅 and thanks for your answer!

---

_[View the full topic](https://meta.discourse.org/t/a-component-for-conditional-ui-elements/110255)._
