Skip to content

Instantly share code, notes, and snippets.

@GDmac
Created July 31, 2012 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GDmac/3216550 to your computer and use it in GitHub Desktop.
Save GDmac/3216550 to your computer and use it in GitHub Desktop.
ExpressionEngine Snippets

ExpressionEngine Snippets

Safe_cracker Select author

<select name="author_id">
  {exp:query sql="SELECT member_id AS member_author_id, username AS member_username, screen_name AS member_screen_name FROM exp_members"}
  <option value="{member_author_id}" {if member_author_id == author_id}selected="selected"{if:elseif  member_author_id == logged_in_member_id}selected="selected"{/if}>{member_screen_name}</option>
  {/exp:query}
</select>

Via: http://expressionengine.com/forums/viewthread/184361/

Channel entries avoid empty category parameter

If you use 0|{param} then if param is empty the tag will not show all entries.

{exp:channel:entries category="0|{embed:categories}" ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment