# Getting template variable to show on Front End

**URL:** <https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665>\
**Category:** Support\
**Created:** [April 25, 2019, 6:03pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665 "2019-04-25T18:03:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 6:03pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/1 "2019-04-25T18:03:06Z")

</div>

I am using MGIX to make a tabbed accordion style element section no my pages. The tabs TV show up in my Resources’ Template Variable section but it will not show on the front end of my website.

What should I put in the Chunk to make it show.  
Note: each tab can have different content placed in them depending on the page.

---

<div class="post-metadata">

**Author:** ![lkfranklin](https://community.modx.com/user_avatar/community.modx.com/lkfranklin/32/52_2.png) [@lkfranklin](https://community.modx.com/u/lkfranklin)\
**Post date:** [April 25, 2019, 6:13pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/2 "2019-04-25T18:13:28Z")

</div>

You need to use getImageList to output the data. Just replace the placeholders with the fields that you’ve setup in your MIGX. Also replace the tvname to whatever you called your MIGX tv.

```auto
[[getImageList? 
    &tvname=`myMIGXtv`
    &tpl=`@CODE:<li>[[+idx]] - [[+title]]</li>`
]]

```

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 6:35pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/3 "2019-04-25T18:35:39Z")

</div>

That didnt work. Below are what the tabs look like ( If you click the plus sign it expands to show more content).  
Right now this shows up on every page that has that template assigned to it. I only want it to show up on the page I select that particular TV for.

 ![02%20PM](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/c8f4334084831aa135e8582138092be4142ca58b.png)

---

<div class="post-metadata">

**Author:** ![vibedesign](https://community.modx.com/user_avatar/community.modx.com/vibedesign/32/741_2.png) [@vibedesign](https://community.modx.com/u/vibedesign)\
**Post date:** [April 25, 2019, 7:40pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/4 "2019-04-25T19:40:14Z")

</div>

Some more of your code (MIGX TV, chunk, call) could probably help to see where the issue is.

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 9:16pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/5 "2019-04-25T21:16:17Z")

</div>

Im just trying to get the steps. Should it be this…

1. Create a TV
2. Create a Chunk with the code for the Accordion
3. Add Item to MIGX
4. put code in Template

---

<div class="post-metadata">

**Author:** ![lkfranklin](https://community.modx.com/user_avatar/community.modx.com/lkfranklin/32/52_2.png) [@lkfranklin](https://community.modx.com/u/lkfranklin)\
**Post date:** [April 25, 2019, 9:24pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/6 "2019-04-25T21:24:55Z")

</div>

> “…but it will not show on the front end of my website”
> 
> “Right now this shows up on every page that has that template assigned to it. I only want it to show up on the page I select that particular TV for.”

I’m a little confused between these two statements. As vibe suggested if you post your code we can probably help a little more. Essentially though the steps you’ve declared in your latest post are correct.

Assuming you’ve set this up as a MIGX TV and the data for the accordion is populated within the template variables tab for the accordion that you’ve set up, then it should only display for that resource. If that’s not the case then you could try calling the snippet uncached by putting an exclamation infront of the snippet name: `[[!getImageLi...]]`.

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 9:27pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/7 "2019-04-25T21:27:10Z")

</div>

The developer before me used this code to call in a TV in their page builder. They put several TV’s in one chunk called Page builder.

 ![51%20PM](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/f46d77ace571e11c007beb2515a799687820c2f6.png)

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 9:29pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/8 "2019-04-25T21:29:42Z")

</div>

They have 8 things called in this Chunk from MIGX. I want mine too show up in this list but when I add the below code to it, it shoows multiple times on a page:  
[[getImageList?  
&tpl=`Accordion`  
&tvname=`Accordion`  
]]

 ![44%20PM](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/972dadd3b81285b0d6e9049831f5ff6923d42721.png)

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [April 25, 2019, 9:34pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/9 "2019-04-25T21:34:51Z")

</div>

Here is the link: [http://dev.sorghumcheckoff.com/ethanolvideo](http://dev.sorghumcheckoff.com/ethanolvideo)

---

<div class="post-metadata">

**Author:** ![bruno17](https://community.modx.com/user_avatar/community.modx.com/bruno17/32/71_2.png) [@bruno17](https://community.modx.com/u/bruno17)\
**Post date:** [April 26, 2019, 6:42am UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/10 "2019-04-26T06:42:36Z")

</div>

I can’t see anything, which shows multiple times on this page

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [April 29, 2019, 7:04pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/11 "2019-04-29T19:04:21Z")

</div>

page looks pretty good, for the multiple times do you mean the two sets of flipping pictures? They appear near the top and then way down near the bottom as well.

everything seems to be working, with your three tabs, just the extra set of flipping pictures, that’s done with js, right? you must be triggering the js again, perhaps with a class?

---

<div class="post-metadata">

**Author:** ![nparker](https://community.modx.com/letter_avatar_proxy/v4/letter/n/4bbf92/32.png) [@nparker](https://community.modx.com/u/nparker)\
**Post date:** [May 2, 2019, 5:51pm UTC](https://community.modx.com/t/getting-template-variable-to-show-on-front-end/665/12 "2019-05-02T17:51:38Z")

</div>

Not sure what I did but I figured it out. It no longer shows multiple times.

Thanks!
