Jump to content

Display Array Element in Template


Recommended Posts


I've added some custom fields in a 3nd party plugin. Using {{var_dump($video->cfields());exit;}} in the template I'm getting the array elements and values, all correct.

array(6) { [0]=> array(3) { ["key"]=> int(1) ["value"]=> string(41) "Visit Club|https://www.diziask.com/clubs/" ["format"]=> string(0) "" } [1]=> array(3) { ["key"]=> int(2) ["value"]=> string(44) "Buy Subtitles|https://www.diziask.com/store/" ["format"]=> string(0) "" } [2]=> array(3) { ["key"]=> int(3) ["value"]=> string(2934) "




" ["format"]=> string(0) "" } [3]=> array(3) { ["key"]=> int(4) ["value"]=> string(24) " https://www.treiler.com" ["format"]=> string(0) "" } [4]=> array(3) { ["key"]=> int(5) ["value"]=> string(22) " https://www.music.com" ["format"]=> string(0) "" } [5]=> array(3) { ["key"]=> int(6) ["value"]=> string(29) " https://www.kameraarkasi.com" ["format"]=> string(0) "" } } 

My question is how I can show only the value of the 3nd element. I tried many ways, some was showing nothing, some others can't completed as I was getting "Broken PHP code" when tried to save the template.

Any help will be highly appreciated.

Thank you


Link to comment
Share on other sites

3 minutes ago, Ryan Ashbrook said:

I assume you mean the "value" item of the 3rd array entry?


Or do you mean the third item ("value") of every entry?

{{foreach $array AS $row}}


I meant the first, and thank you so much for your prompt attention to help me. Running to my site to test it 🙂

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...