Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7581945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:19:09+00:00 2026-05-30T18:19:09+00:00

The |explode:, part of the code below doesn’t appear to be working and the

  • 0

The |explode:"," part of the code below doesn’t appear to be working and the foreach $widgets_ids only ever loops once. I have tried adding {$widgets_ids} for debugging and this displays Array, so it is half working.

{foreach $layout_containers.rows as $row}           
<td class="layout_container" data-cid="{$row.container_id.fvalue}">
    Container: <strong>{$row.container_key.fvalue}</strong>
    <br />
    <a class="btnMed" rel="rename_container" href="javascript:;">Rename</a>
    <a class="btnMed" rel="delete_container" href="javascript:;">Delete</a>

    {if $row.widgets_ids.value}
        {assign var="widgets_ids" value=$row.widgets_ids.fvalue|explode:","}                        
        {foreach $widgets_ids as $widgets_id}
            {assign var="widget" value=$widgets.rows[$widgets_id]}
            <div data-widget="{$widget.id.fvalue}" class="widget ui-draggable">
                <img align="middle" src="{$HOME}{$TEMPLATE_HOME}/admin/images/icons/drag_drop.png" alt="{$widget.name.fvalue}" />
                {$widget.name.fvalue}
            </div>  
        {/foreach}
    {/if}

    {* droparea widget *}
    <div class="drop_area">drop area</div>
</td>
{/foreach}

Output array sent to the page:

    [widgets] => Array
        (
            [type] => Table
            [rowcount] => 5
            [name] => widgets
            [rows] => Array
                (
                    [0] => Array
                        (
                            [id] => Array
                                (
                                    [name] => widgets.widget_id
                                    [value] => 1
                                    [fvalue] => 1
                                )
                            [name] => Array
                                (
                                    [name] => widgets.widget_name
                                    [value] => Featured
                                    [fvalue] => Featured
                                )
                            [fixed] => Array
                                (
                                    [name] => widgets.widget_fixed
                                    [value] => 0
                                    [fvalue] => 0
                                )
                            [title] => Array
                                (
                                    [name] => widgets.widget_title
                                    [value] => We recommend these bookmakers
                                    [fvalue] => We recommend these bookmakers
                                )
                            [description] => Array
                                (
                                    [name] => widgets.widget_description
                                    [value] => 
                                    [fvalue] => 
                                )
                            [image] => Array
                                (
                                    [name] => widgets.widget_image
                                    [value] => 
                                    [fvalue] => 
                                )
                            [status] => Array
                                (
                                    [name] => widgets.widget_status
                                    [value] => ENABLED
                                    [fvalue] => Enabled
                                )
                            [template] => Array
                                (
                                    [name] => widgets.widget_template
                                    [value] => widgets/featured.tpl
                                    [fvalue] => widgets/featured.tpl
                                )
                        )
                    [1] => Array
                        (
                            [id] => Array
                                (
                                    [name] => widgets.widget_id
                                    [value] => 2
                                    [fvalue] => 2
                                )
                            [name] => Array
                                (
                                    [name] => widgets.widget_name
                                    [value] => Tips
                                    [fvalue] => Tips
                                )
                            [fixed] => Array
                                (
                                    [name] => widgets.widget_fixed
                                    [value] => 0
                                    [fvalue] => 0
                                )
                            [title] => Array
                                (
                                    [name] => widgets.widget_title
                                    [value] => Betting Tips
                                    [fvalue] => Betting Tips
                                )
                            [description] => Array
                                (
                                    [name] => widgets.widget_description
                                    [value] => 
                                    [fvalue] => 
                                )
                            [image] => Array
                                (
                                    [name] => widgets.widget_image
                                    [value] => 
                                    [fvalue] => 
                                )
                            [status] => Array
                                (
                                    [name] => widgets.widget_status
                                    [value] => ENABLED
                                    [fvalue] => Enabled
                                )
                            [template] => Array
                                (
                                    [name] => widgets.widget_template
                                    [value] => widgets/tips.tpl
                                    [fvalue] => widgets/tips.tpl
                                )
                        )
                    [2] => Array
                        (
                            [id] => Array
                                (
                                    [name] => widgets.widget_id
                                    [value] => 3
                                    [fvalue] => 3
                                )
                            [name] => Array
                                (
                                    [name] => widgets.widget_name
                                    [value] => Casion
                                    [fvalue] => Casion
                                )
                            [fixed] => Array
                                (
                                    [name] => widgets.widget_fixed
                                    [value] => 0
                                    [fvalue] => 0
                                )
                            [title] => Array
                                (
                                    [name] => widgets.widget_title
                                    [value] => Casion
                                    [fvalue] => Casion
                                )
                            [description] => Array
                                (
                                    [name] => widgets.widget_description
                                    [value] => <p>Best slot &amp; Live casino &pound;75 welcome bonus!</p>
                                    [fvalue] => <p>Best slot &amp; Live casino &pound;75 welcome bonus!</p>
                                )
                            [image] => Array
                                (
                                    [name] => widgets.widget_image
                                    [value] => /widgets/4f4ceb235bb9a_banner-casino.png
                                    [fvalue] => /widgets/4f4ceb235bb9a_banner-casino.png
                                )
                            [status] => Array
                                (
                                    [name] => widgets.widget_status
                                    [value] => ENABLED
                                    [fvalue] => Enabled
                                )
                            [template] => Array
                                (
                                    [name] => widgets.widget_template
                                    [value] => widgets/banner.tpl
                                    [fvalue] => widgets/banner.tpl
                                )
                        )
                    [3] => Array
                        (
                            [id] => Array
                                (
                                    [name] => widgets.widget_id
                                    [value] => 4
                                    [fvalue] => 4
                                )
                            [name] => Array
                                (
                                    [name] => widgets.widget_name
                                    [value] => Football
                                    [fvalue] => Football
                                )
                            [fixed] => Array
                                (
                                    [name] => widgets.widget_fixed
                                    [value] => 0
                                    [fvalue] => 0
                                )
                            [title] => Array
                                (
                                    [name] => widgets.widget_title
                                    [value] => Football
                                    [fvalue] => Football
                                )
                            [description] => Array
                                (
                                    [name] => widgets.widget_description
                                    [value] => <p>Bet now &amp; wind a real football ball!</p>
                                    [fvalue] => <p>Bet now &amp; wind a real football ball!</p>
                                )
                            [image] => Array
                                (
                                    [name] => widgets.widget_image
                                    [value] => /widgets/4f4ceb44a7072_banner-football.png
                                    [fvalue] => /widgets/4f4ceb44a7072_banner-football.png
                                )
                            [status] => Array
                                (
                                    [name] => widgets.widget_status
                                    [value] => ENABLED
                                    [fvalue] => Enabled
                                )
                            [template] => Array
                                (
                                    [name] => widgets.widget_template
                                    [value] => widgets/banner.tpl
                                    [fvalue] => widgets/banner.tpl
                                )
                        )
                    [4] => Array
                        (
                            [id] => Array
                                (
                                    [name] => widgets.widget_id
                                    [value] => 5
                                    [fvalue] => 5
                                )
                            [name] => Array
                                (
                                    [name] => widgets.widget_name
                                    [value] => Horses
                                    [fvalue] => Horses
                                )
                            [fixed] => Array
                                (
                                    [name] => widgets.widget_fixed
                                    [value] => 0
                                    [fvalue] => 0
                                )
                            [title] => Array
                                (
                                    [name] => widgets.widget_title
                                    [value] => Horses
                                    [fvalue] => Horses
                                )
                            [description] => Array
                                (
                                    [name] => widgets.widget_description
                                    [value] => <p>Bet now &amp; win borse statue!</p>
                                    [fvalue] => <p>Bet now &amp; win borse statue!</p>
                                )
                            [image] => Array
                                (
                                    [name] => widgets.widget_image
                                    [value] => /widgets/4f4ceb66381ab_banner-horses.png
                                    [fvalue] => /widgets/4f4ceb66381ab_banner-horses.png
                                )
                            [status] => Array
                                (
                                    [name] => widgets.widget_status
                                    [value] => ENABLED
                                    [fvalue] => Enabled
                                )
                            [template] => Array
                                (
                                    [name] => widgets.widget_template
                                    [value] => widgets/banner.tpl
                                    [fvalue] => widgets/banner.tpl
                                )
                        )
                )
        )

Layout_containers

[layout_containers] => Array
    (
        [type] => Table
        [rowcount] => 3
        [name] => layout_containers
        [header] => Array
            (
                [names] => Array
                    (
                        [0] => container_id
                        [1] => id
                        [2] => container_key
                        [3] => container_title
                        [4] => widgets_ids
                    )
                [container_id] => Array
                    (
                        [enabled] => 0
                        [sort] => ASC
                        [nextsort] => DESC
                        [name] => layout_containers.layout_container_id
                        [label] => Container Id
                        [url] => /gambler_compendium/admin/layout/widgets/id/1/layout_containers.layout_containers.layout_container_id/desc
                        [formname] => layout_containers.layout_containers.layout_container_id
                        [hidden] =>
                    )
                [id] => Array
                    (
                        [enabled] => 0
                        [sort] => ASC
                        [nextsort] => DESC
                        [name] => layout_containers.layout_id
                        [label] => Id
                        [url] => /gambler_compendium/admin/layout/widgets/id/1/layout_containers.layout_containers.layout_id/desc
                        [formname] => layout_containers.layout_containers.layout_id
                        [hidden] => 
                    )
                [container_key] => Array
                    (
                        [enabled] => 1
                        [sort] => ASC
                        [nextsort] => DESC
                        [name] => layout_containers.layout_container_key
                        [label] => Container Key
                        [url] => /gambler_compendium/admin/layout/widgets/id/1/layout_containers.layout_containers.layout_container_key/desc
                        [formname] => layout_containers.layout_containers.layout_container_key
                        [hidden] => 
                    )
                [container_title] => Array
                    (
                        [enabled] => 0
                        [sort] => ASC
                        [nextsort] => DESC
                        [name] => layout_containers.layout_container_title
                        [label] => Container Title
                        [url] => /gambler_compendium/admin/layout/widgets/id/1/layout_containers.layout_containers.layout_container_title/desc
                        [formname] => layout_containers.layout_containers.layout_container_title
                        [hidden] => 
                    )
                [widgets_ids] => Array
                    (
                        [enabled] => 0
                        [sort] => ASC
                        [nextsort] => DESC
                        [name] => layout_containers.widgets_ids
                        [label] => Widgets Ids
                        [url] => /gambler_compendium/admin/layout/widgets/id/1/layout_containers.layout_containers.widgets_ids/desc
                        [formname] => layout_containers.layout_containers.widgets_ids
                        [hidden] => 
                    )
            )
        [field] => Array
            (
                [names] => Array
                    (
                    )
            )
        [rows] => Array
            (
                [0] => Array
                    (
                        [container_id] => Array
                            (
                                [name] => layout_containers.layout_container_id
                                [value] => 113
                                [fvalue] => 113
                            )
                        [id] => Array
                            (
                                [name] => layout_containers.layout_id
                                [value] => 1
                                [fvalue] => 1
                            )
                        [container_key] => Array
                            (
                                [name] => layout_containers.layout_container_key
                                [value] => sidebarLeft
                                [fvalue] => sidebarLeft
                            )
                        [container_title] => Array
                            (
                                [name] => layout_containers.layout_container_title
                                [value] => 
                                [fvalue] => 
                            )
                        [widgets_ids] => Array
                            (
                                [name] => layout_containers.widgets_ids
                                [value] => 1,2
                                [fvalue] => 1,2
                            )
                    )
                [1] => Array
                    (
                        [container_id] => Array
                            (
                                [name] => layout_containers.layout_container_id
                                [value] => 115
                                [fvalue] => 115
                            )
                        [id] => Array
                            (
                                [name] => layout_containers.layout_id
                                [value] => 1
                                [fvalue] => 1
                            )
                        [container_key] => Array
                            (
                                [name] => layout_containers.layout_container_key
                                [value] => sidebarRight_banners
                                [fvalue] => sidebarRight_banners
                            )
                        [container_title] => Array
                            (
                                [name] => layout_containers.layout_container_title
                                [value] => 
                                [fvalue] => 
                            )
                        [widgets_ids] => Array
                            (
                                [name] => layout_containers.widgets_ids
                                [value] => 3,4,5
                                [fvalue] => 3,4,5
                            )
                    )
                [2] => Array
                    (
                        [container_id] => Array
                            (
                                [name] => layout_containers.layout_container_id
                                [value] => 114
                                [fvalue] => 114
                            )
                        [id] => Array
                            (
                                [name] => layout_containers.layout_id
                                [value] => 1
                                [fvalue] => 1
                            )
                        [container_key] => Array
                            (
                                [name] => layout_containers.layout_container_key
                                [value] => sidebarRight_bannersList
                                [fvalue] => sidebarRight_bannersList
                            )
                        [container_title] => Array
                            (
                                [name] => layout_containers.layout_container_title
                                [value] => 
                                [fvalue] => 
                            )
                        [widgets_ids] => Array
                            (
                                [name] => layout_containers.widgets_ids
                                [value] => 
                                [fvalue] => 
                            )
                    )
            )
    )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:19:11+00:00Added an answer on May 30, 2026 at 6:19 pm
    {$widgets_ids = ","|explode:"1,2,3,4,5,6,7,8"}
    {foreach $widgets_ids as $widget_id}
        {$widget_id}
    {/foreach}
    

    works perfectly fine. You have some problems in your code.


    {assign var="widgets_ids" value=$row.widgets_ids.fvalue|explode:","}
    

    should be

    {assign var="widgets_ids" value=","|explode:$row.widgets_ids.fvalue}
    

    or

    {$widgets_ids = ","|explode:$row.widgets_ids.fvalue}
    

    {foreach $widgets_ids as $widgets_id}
    

    should probably be

    {foreach $widgets_ids as $widget_id}
    

    {assign var="widget" value=$widgets.rows[$widget_id]}
    

    may also be

    {assign var="widget" value=$widgets.rows.$widget_id}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which (I think) will only verify the domain of
i have the following code part in one of my classes: $l = new
There are a few parts to this code. The first part is creating fixtures.
This PHP code below will take an image and add the word _thumb in
I have this simple loop: for($i=$_POST['position'];$i<count($myFiles);$i++) { $withoutNumber = explode(_,$myFiles[$i]); $noNr = unset($withoutNumber[0]); }
What you see below is a part of my script. The problem is that
Ok so whilst I have been working on my PHP and MySQL skills I
How can I do the following without lots of complicated code? Explode each value
In Magento, I've created a phtml template file with the code below. I got
update: the answer from virtualeyes (below) looks pretty nice: but now a bit code-sanititzing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.