rsanchez / json

Output ExpressionEngine data in JSON format.
http://devot-ee.com/add-ons/json/
100 stars 236 forks source link

Allow {member_id} in member_id parameter to get logged in user #42

Closed gstjohn closed 9 years ago

gstjohn commented 9 years ago

I was in a place where I needed to get the logged in user's member data, however, the {member_id} tag isn't being parsed and therefore returns no results. This allows you to do something like:

{exp:json:members member_id="{member_id}"}

Because of CI needing to run a query to parse global vars, I had to pull the parsing up before your query happens.

rsanchez commented 9 years ago

Thanks for this! I definitely want to support this use case. However, I'd like to use a different approach here. EE already has a paradigm in place for this: https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html#author-id

So that the syntax here would be

{exp:json:members member_id="CURRENT_USER"}

Not sure if you have the time to take a stab at changing this PR. If not, I could probably get this added in the next couple days or so.

gstjohn commented 9 years ago

That should do it. Let me know if it needs anything else.