0

I am using the Add-On ajw_export and Low Variables to export a csv of member details. When the page loads the member data is exported on page load. I would like to use Low Variables for early parsing, to allow the system to know which member group is trying to access the page.

Im having two issues, either the content is exported regardless of which member group is logged in or else nothing is exported. Im certain I have written the tags incorrectly. Any help would be appreciated

               `{exp:low_variables:parse var="gv_member_export" multiple="yes"}

                    {if logged_in_group_id == 1}

                        {exp:ajw_export sql="SELECT * FROM exp_member_data" format="csv" filename="ascertusers.csv" }

                    {if:else}

                        Theres Nothing here for you to see

                    {/if}

                {/exp:low_variables:parse}`
1

If I understand correctly, you only want to execute the exp:ajw_export tag if the logged in member ID is 1. For this, you don't need the low_variables:parse tag. Instead, in the Low Variables settings, make sure Early Parsed Member Data is set to Yes. Then use (simple, pre EE2.9) conditionals:

{if logged_in_group_id == 1}
    {exp:ajw_export sql="SELECT * FROM exp_member_data" format="csv" filename="ascertusers.csv"}
{/if}
{if logged_in_group_id != 1}
    There's Nothing here for you to see
{/if}

The LV tag syntax you're using makes early parsing irrelevant. Also, the multiple="yes" parameter only applies to a number of variable types.

| improve this answer | |
  • Hey Low, thanks for the reply, appreciated. I initially had written my tags as above, although the export is automatically downloading regardless of which member group was logged in or even if i fake a member group. I was hoping Low Variables would have early parsed the logged_in tags and member export add-on before downloading automatically. No Joy :( – Sam Crowe Dec 12 '14 at 12:42
0

Resolved: Using the tags provided by low and by placing the ajw_export on to a separate template.

                {if logged_in_group_id == 1}
                    <a href="template_group/template_name" class="button_export">Download</a> 
                {/if}
                {if logged_in_group_id != 1}
                    There's Nothing here for you to see
                {/if}
| improve this answer | |

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.