0

Is there any reason why I shouldn't nest visitor:update_form within visitor:details? The reason I want to do this is because visitor:update_form doesn't seem to work with the native Relationships field (i.e. can't get details from it in the template) and I want to allow / disallow access based on whether a user is related to an entry. Nesting seems to work, but it would be good to know I'm following best practice.

{exp:visitor:details}
    {if '{client_event:url_title}' == '{segment_2}'}
        {exp:visitor:update_form preserve_checkboxes="no" return="{uri_string}"}
            ...allow access, updates etc.
        {/exp:visitor:update_form}
    {if:else}
        ...don't allow access
    {/if}
{/exp:visitor:details}
0

Please try your code with embed.

Create new template in your template group having proper name .your_template_name

Now, your main template having below code :-

{exp:visitor:details}
    {if '{client_event:url_title}' == '{segment_2}'}
        {embed="your_template_group/.your_template_name"}
    {if:else}
        ...don't allow access
    {/if}
{/exp:visitor:details}

And your embed having below code :-

{exp:visitor:update_form preserve_checkboxes="no" return="{uri_string}"}
    ...allow access, updates etc.
{/exp:visitor:update_form}
  • Thank you - I'm saying the nesting works, I just want to know if it's good practice. I know you shouldn't nest identical tags, but this isn't the case here. I'd rather not embed as I already have embeds (there would be embeds within embeds). – user2265915 Jan 16 '18 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.