Impress Design Home

Show Member Chunk - MODX

by :: 16 October

ShowMemberChunk is a super-lightweight MODX snippet that allows you to customize content based upon whether or not someone is a member of a website group. It is designed to be easy to use and implement and can be up and running in minutes. It works in MODX Revolution versions 2.2.7 and above. It has not been tested for earlier versions.

Usage

Download and install the package through the Package Manager. DOWNLOAD HERE »

Chunks Needed

Where you would like to show alternate content for members logged into the site create two chunks: one for members and one for non-members. You can leave the “out” chunk blank if you would prefer to not show anything for non-members.

Member view

Example usage: Non-members see an advertisement asking them to join the organization; members see a menu with member-only content.

Non-Member view

Member Check

In your snippet call you must tell the snippet which member groups to look for. For instance, if you have a site where there are Premium members and Basic members and want to show the chunk to all members of each group use a comma separated list for the member groups as in the example below:

Member view home page

[[!showChunk? &group=`Administrator,Activist Members,Premium Members`
&in_chunk=`privateSiteNav` &out_chunk=`membershipPromote`]]

&group is showing this member groups for the site - there are Administrators, Members, Activist and Premium Members listed in the example above.

&in_chunk shows the “privateSiteNav” chunk if they are logged in as one of the members above.

&out_chunk shows the “membershipPromote” chunk if they are not logged into the site or if they are not a member of one of the groups listed.

ShowMemberCheck can be used multiple times on any page of a website with various chunks. For instance, as a logged-in member you can access content for members only and you can view menus and promotions not available to others.

Limitations

In order to work properly within the chunks you will need to use a separate browser to view the front-end of the site and the manager. (When logged into the manager you are effectively always logged into the site.)

Download the Package

If you choose to download from here you must manually upload to to your server in the core .. packages folder. Note: if you are on a Mac / Safari go into preferences and disable "Open "safe" files after downloading" in the general tab. Download »


Small Business Guide To Winning Online

Avoiding Extinction

Small Business Guide To Online SuccessFREE eBOOK!
Learn what it takes to succeed and thrive as a small business online.

DOWNLOAD

Dominate Your Market

Email Marketing Manifesto

Email Marketing ManifestoChange how you market to your customers with email.

DOWNLOAD

Join the Newsletter

Keep up-to-date with new articles and marketing ideas