ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Help parsing TMPL variables in module

September 26, 2011 10:23am

Subscribe [2]
  • #1 / Sep 26, 2011 10:23am

    rt30000

    125 posts

    I am working on a custom module and for some reason I can only get a single variable between my tags to parse. The array of data I am passing is:

    Array ( [0] => Array ( [dealer_name] => My Company Name [dealer_id] => 2 [dealer_address] => 1234 Some Road NW [dealer_phone] => 555-699-9988 [dealer_city] => Las Vegas [dealer_state] => NV [dealer_postal_code] => 558894 ) )

    and my template code that is being parsed is

    {exp:s2d_dealers:dealer}
         <div id="dealer-details">
          <strong>Your Dealer</strong>
    
           {dealer_name}
          Phone: {dealer_phone}
    
           Address: 
    
           {dealer_address}
    
           {dealer_city}, {dealer_state} {dealer_postal_code}
          
          <a href="http://{path=dealers/selector}">Select a different Dealer</a>
         </div>
        {/exp:s2d_dealers:dealer}

    ...but the only variable that ever gets parsed is just the Dealer Name and none of the others (although they clearly exist in the array). Thoughts?

  • #2 / Sep 26, 2011 10:41am

    glenndavisgroup

    436 posts

    Not sure if this is the answer but don’t you need array value separators like this:

    Array ( [0] => Array ( [dealer_name] => My Company Name, [dealer_id] => 2, [dealer_address] => 1234 Some Road NW, [dealer_phone] => 555-699-9988, [dealer_city] => Las Vegas, [dealer_state] => NV, [dealer_postal_code] => 558894))

    Mike

  • #3 / Sep 26, 2011 10:47am

    rt30000

    125 posts

    This was just the result of print_r function, I don’t believe it shows the separators.

  • #4 / Sep 26, 2011 10:50am

    rt30000

    125 posts

    It seems that no matter what the order I place the variables in the template, the only one that ever gets parsed is {dealer_name}. Displaying the raw TAGDATA the only {} tag is {dealer_name} as well, the others disappear?

  • #5 / Sep 27, 2011 8:33am

    rt30000

    125 posts

    I am wondering if it has something to do with being between an entries loop (I am using Structure).

    *YES* It would appear so. Now to find a fix…

  • #6 / Sep 28, 2011 12:38pm

    rt30000

    125 posts

    Anybody? I think I should have posted this in development…?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases