• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Reassigning a variable in a template with a view parameter

#1
I'm passing a few different variables into my template:

Code:
    $viewParams = array('catalogthreads' => $catalogthreads,
                        'transthreads' => $transthreads);
I'd like to create a new $threads variable and set $threads == $catalogthreads, spit out the threads, then set $threads == $transthreads, something like:

Code:
<div class="discussionList section sectionMain">
    <xen:set var="$threads">{xen:raw $catalogthreads}</xen:set>
        <xen:foreach loop="$threads" value="$thread">
            <xen:include template="thread_list" />
    </xen:foreach>
   <xen:set var="$threads">{xen:raw $transthreads}</xen:set>
        <xen:foreach loop="$threads" value="$thread">
            <xen:include template="thread_list" />
    </xen:foreach>
</div>
Is there a way to do this?
 

Valhalla

Well-known member
#2
You can't use <xen:set> to assign arrays.

Maybe you could use <xen:map>?

<xen:map from="$transthreads" to="$threads" />

Although I'm am unsure of your exact requirements.
 
#3
That's what i'm trying to do, at the very basic core.

i'm trying to see if i can figure out how to use <xen:map> <xen:include> to get this to work