# Segment property

**URL:** <https://forums.realmacsoftware.com/t/segment-property/45628>\
**Category:** RapidWeaver Elements\
**Created:** [December 15, 2024, 11:34am UTC](https://forums.realmacsoftware.com/t/segment-property/45628 "2024-12-15T11:34:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bartje](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bartje/32/1210_2.png) [@Bartje](https://forums.realmacsoftware.com/u/Bartje)\
**Post date:** [December 15, 2024, 11:34am UTC](https://forums.realmacsoftware.com/t/segment-property/45628/1 "2024-12-15T11:34:15Z")

</div>

I have a custom component with a segment containing two options: “on” and “off.” How can I ensure that the input values in the properties are not passed through when the segment is set to “off,” and therefore have no effect in the template?  
 ![Scherm­afbeelding 2024-12-15 om 12.16.13](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/b/8b6677462da8ad6beb9340851c49bbccbb53f52f.png)

This is the component code:

 ![Scherm­afbeelding 2024-12-15 om 12.33.58](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/d/1/d1d61f8af6fcbba2a9381768d5ef37a5e670a42d.png)

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [December 15, 2024, 3:55pm UTC](https://forums.realmacsoftware.com/t/segment-property/45628/2 "2024-12-15T15:55:30Z")

</div>

Hmm, you could use the hooks file to check what value is selected and generate the relevant HTML based on that…

Here’s the [Custom Component from the video](elementsapp://downloadDocument/ErWqzlBEv0JS).

Let me know if that’d work for you, if not @ben or @tpbradley might be able to suggest other ways to do this!

---

<div class="post-metadata">

**Author:** ![Bartje](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bartje/32/1210_2.png) [@Bartje](https://forums.realmacsoftware.com/u/Bartje)\
**Post date:** [December 15, 2024, 4:30pm UTC](https://forums.realmacsoftware.com/t/segment-property/45628/3 "2024-12-15T16:30:02Z")

</div>

Thanks again Dan for your excellent support : even on a cloudy Sunday afternoon 😀 It works fine now 😅

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [December 15, 2024, 5:30pm UTC](https://forums.realmacsoftware.com/t/segment-property/45628/4 "2024-12-15T17:30:10Z")

</div>

Super-duper, you’re welcome! Also, there’s nothing better than tinkering away at the computer on a dreary Sunday afternoon ☺

---

<div class="post-metadata">

**Author:** ![Bartje](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bartje/32/1210_2.png) [@Bartje](https://forums.realmacsoftware.com/u/Bartje)\
**Post date:** [December 15, 2024, 7:55pm UTC](https://forums.realmacsoftware.com/t/segment-property/45628/5 "2024-12-15T19:55:05Z")

</div>

And once again, a (limited) devpack is ready. It’s truly incredible what possibilities Elements offers to build components yourself in a relatively straightforward way. Bit by bit, we’re starting to understand the structure of certain codes. Before I started with custom components, all programming code was completely incomprehensible to me, but now I’m beginning to grasp a little of the structure and underlying logic, even if still in a very limited way. However, it remains fascinating, and every small step forward motivates to keep trying. 🤓
