I’m trying to pass the current username variable into an embed template to return a user’s profile image. For some reason the username doesn’t work when it reaches the embed template in the parameter.
Main
{exp:comment:form channel="single_life" form_id="commentform" form_class="form"}
{embed="embeds/_profile_image_for_comments" commenter_user_name="{username}" }
{/exp:comment:form}Embed
{exp:channel:entries channel="member" limit="1" username="{embed:commenter_user_name}" dynamic="no"}
{member_photos}
{if '{primary}'}
<input type="text" value='{exp:imgsizer:size image="{image}" width="39" height="39" alt="{title}"}' name="member_thumb_image" />
{/if}
{/member_photos}
{/exp:channel:entries}Also, when I experiment with the embed code below, the first username in the database is displayed even though I sent through the logged in user’s name from the main template. Hopefully this might clue you in on the underlying issue.
{exp:channel:entries channel="member" limit="1" dynamic="no"}
{embed:commenter_user_name}
{member_photos}
{if '{primary}'}
<input type="text" value='{exp:imgsizer:size image="{image}" width="39" height="39" alt="{title}"}' name="member_thumb_image" />
{/if}
{/member_photos}
{/exp:channel:entries}