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.

custom_profile_data inside a snippet?

April 02, 2012 5:22pm

Subscribe [2]
  • #1 / Apr 02, 2012 5:22pm

    kokako

    57 posts

    I’ve had a look at Low’s parse order guide, and as I understand snippets get parsed first.

    This returns blank values. Any idea why?

    my snippet:

    {exp:member:custom_profile_data}
    <input type="hidden" name="first_name" value="{first_name}">
    <input type="hidden" name="last_name" value="{last_name}">
    {/exp:member:custom_profile_data}
  • #2 / Apr 03, 2012 1:38pm

    Kevin Smith

    4784 posts

    Hi kokako,

    Snippets aren’t parse themselves. Instead, they’re expanded into the template and then the template itself is parsed. (In other words, there’s not a layer of parsing templates before their contents is dumped into the rest of the template.)

    That’s not necessarily the reason this isn’t working, however. As a basic troubleshooting step, if something about a snippet isn’t working properly, take the snippet out of the equation. Place the above code directly in the template. Is it still not working? Share with us the context of the above code and we’ll try to help you figure it out.

  • #3 / Apr 03, 2012 5:02pm

    kokako

    57 posts

    yes, it works directly in a template.

    I have a lot of member custom data, and for somethings it would be handy to be able to access that data from within snippets.

  • #4 / Apr 05, 2012 2:06pm

    Shane Eckert

    7174 posts

    Hey kokako,

    Would you mind showing us the entire template? It would be nice to see where you are putting the snippets and when you put the code right into the template, did you put it in the same place you were calling the snippet from?

    Cheers,

  • #5 / Apr 05, 2012 7:13pm

    kokako

    57 posts

    this thread can be moved to http://ellislab.com/forums/viewthread/214529/#993164

    I am using a module that uses some variable names that are identical to some that I have created in member custom fields.

    So when I try to mix the two, that is use {exp:member:custom_profile_data} inside the modules tags (in this case Membrr) my member custom profile variable get cancelled out, or rather become inaccessible.

    I’ve been advised that I need to call the custom data earlier in the template and assign new, temporary variable names and I’m looking for ways to do this.

    The last suggestion I received from Dan Decker was to use the Stash module/plugin, but I’d rather not have to use yet another plugin… I’m really looking to achieve this internally.

  • #6 / Apr 06, 2012 4:22pm

    Kevin Smith

    4784 posts

    Since it looks like you’re working on solving this yourself, I’ll be glad to mark this thread as resolved. If any new questions come up as you’re working on it, please feel free to open up a new thread and ask!

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

ExpressionEngine News!

#eecms, #events, #releases