Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.25 KB

readme.textile

File metadata and controls

35 lines (23 loc) · 1.25 KB

Assets Meta: Members Only

This extension is used directly with Pixel & Tonic’s Assets module. It adds a new meta field in the HUD to define if an asset is intended for members only or not.

Requirements

  • ExpressionEngine 2.1.3 or later
  • Assets 1.1 or later

Installation

  • Upload the assets_meta_members_only folder to system/expressionengine/third_party/
  • Enable Assets Meta: Members Only in Add-Ons → Extensions

Usage

Upon installation, each of your files’ HUDs will get a new “Members Only?” field. The options are simply “Yes|No” with respective values of “y|n”

You can filter your Assets fields to only show files which are or aren’t “members only” by adding members_only="y|n" to your opening Assets field tag. Note that simply setting an asset’s meta tag to “Yes” won’t hide the asset from your users. You will still need to additional logic to your templates for this.

This field value defaults to no.

Sample code:

Member Only Assets

{if logged_in}
  {my_assets_field members_only='y'}
    {filename}
  {/my_assets_field}
{/if}

Public Only Assets

{my_assets_field members_only='n'}
  {filename}
{/my_assets_field}