54

DAP Shortcodes

DAP has a feature called “DAP Shortcodes” that allows you to do partial or in-page content protection.

(RELATED: If you are looking for merge tags to place into WordPress posts, then see Merge Tags for WordPress. For email-related merge tags, see Merge Tags for Email).

So if you had a blog post or page with 3 paragraphs of text and a video, you can protect just the video from certain groups of viewers, and leave the text portions open for anyone to read.

And you can…

a) Replace the text that is enclosed by the short codes with an error message.

So entering this in to your page/post’s body…

… then becomes this…

You can fully customize the style and text of the error message.

Or…

b) You can make the private text completely disappear from the page

By adding an additional parameter to the shortcode, you can make the error message completely disappear.

So this…

…is seen like this by the visitor…

No error message at all – like that section of content never even existed, and no errors or warnings shown either.

 

Teaser On Steroids

The DAP Shortcodes may be used to quickly protect content that you don’t necessarily wish to create a DAP Product for.

So if you don’t care about dripping some content, but just wish to protect it from say, non-members, or make it available only to certain “levels”, then you can do it by using the DAP Shortcode, and not have to worry about adding it to any particular level first.

These Shortcodes may or may not be used within content that is already protected as part of a DAP Product. Totally up to you.

Shortcode Summary

This section just lists all of the available shortcodes so you can quickly see everything in one glance. Details about each shortcode is available in the next section below.

Basic DAP Shortcode
[DAP]...private content...[/DAP]

Expanded DAP Shortcode Options
[DAP]...private...[/DAP] [DAP hasAccessTo="1" errMsgTemplate=""]...private...[/DAP] [DAP hasAccessTo="1,2,3" errMsgTemplate="SHORT"]...private...[/DAP] [DAP hasAccessTo="1" errMsgTemplate="SHORT"]...private...[/DAP] [DAP hasAccessTo="1,2,3" errMsgTemplate="LONG"]...private...[/DAP]

Member-Specific Content
[DAP userId="144"]protected content[/DAP]

In-Page Dripping
[DAP startday="1" endday="9999" hasAccessTo="1"]Video 1 Embed Code[/DAP] [DAP startday="2" endday="9999" hasAccessTo="1"]Video 2 Embed Code[/DAP] [DAP startday="3" endday="9999" hasAccessTo="1"]Video 3 Embed Code[/DAP]

If you don’t include endday in your shortcode, then the default value for endday is taken as 9999 – which means forever access.

Hiding Content From Logged-In Members
(a.k.a showing content only to visitors)
[DAP isLoggedIn="N"]....content to show only to NON-members... [/DAP]

Showing Different Content To Visitors -vs- Members
Use both codes as shown below (one following the other):

[DAP isLoggedIn="N"]....sales page content shown only to visitors (and members who have not yet logged in)...[/DAP][DAP isLoggedIn="Y"]...member content that will replace sales content shown only to logged-in members...[/DAP]
publicUntil
[DAP publicUntil="2012-12-31" hasAccessTo="1"]This message will be completely public UNTIL (and including) December 31st, 2012 after which it will be protected as part of product 1[/DAP]

publicAfter
[DAP publicAfter="2012-01-01" hasAccessTo="1"]This message will be completely public AFTER (and including) January 1st, 2012 until which time it will be protected as part of product 1[/DAP]

hasNoAccessTo
[DAP hasAccessTo="2" hasNoAccessTo="1,3" ]This message will appear only to active users of product 2 but only for those who DO NOT also have access to products 1 or 3[/DAP]

startday / endday
[DAP hasAccessTo="2" startday="1" endday="1"]This message will appear to you only to users of Product 2, on Day 1 and no further[/DAP]

startdate / enddate
[DAP hasAccessTo="2" startdate="2012-01-01" enddate="2012-01-31"]This message will appear to you only to users of Product 2, between the dates of Jan 1st, 2012 and Jan 31st, 2012 - and no further[/DAP]
Negative Days
[DAP hasAccessTo="2" startDay="-6" endDay="-3"]Howdy[/DAP]

Error Message From File
[DAP hasAccessTo="2" startday="1" endday="1" errMsgTemplate="file:http://YourSite.com/customMessage.html"]This message will appear to you only today[/DAP]

[DAPUserLinks]

[DAPUserLinks showProductName="Y" showAccessStartDate="Y" showAccessEndDate="Y" showDescription="Y" showLinks="Y" orderOfLinks="NEWESTFIRST" howManyLinks="10000" errMsgTemplate="SHORT" productId="ALL" dateFormat="YYYY-MM-DD" showproductcount="Y"]

orderOfLinks

orderOfLinks can have one of two values…

NEWESTFIRST will drip newly dripped links at the top. So day 7 link will be above day 1 link.

OLDESTFIRST will drip newly dripped links towards the bottom. So day 1 link will be above day 7 link.

showproductcount=”N” will disable the heading “You have access to X products” at the top of the “My Content” section.

So, here’s another version of the DAPUserLinks shortcode:

[DAPUserLinks showProductName="Y" showAccessStartDate="Y" showAccessEndDate="Y" showDescription="Y" showLinks="Y" orderOfLinks="OLDESTFIRST" howManyLinks="10000" errMsgTemplate="SHORT" productId="ALL" dateFormat="YYYY-MM-DD" showproductcount="N"]

[DAPComingSoon]

[DAPComingSoon showProductName="Y" showAccessStartDate="Y" showAccessEndDate="Y" showDescription="Y" showLinks="Y" orderOfLinks="NEWESTFIRST" howManyLinks="10000" errMsgTemplate="SHORT" productId="ALL" makelinksclickable="N" dateFormat="YYYY-MM-DD"]

[DAPUserProfile]

[DAPUserProfile showFirstName="Y" showLastName="Y" showUserName="Y" showEmail="Y" showPassword="Y" showAddress1="Y" showAddress2="Y" showCity="Y" showState="Y" showZip="Y" showCountry="Y" showPhone="Y" showFax="Y" showCompany="Y" showTitle="Y" showPaypalEmail="Y" showOptedOut="Y" showCustomFields="Y"]

[DAPUpline]

To show affiliate’s/sponsor’s first name:
[DAPUpline showField="first_name"]

To show affiliate’s/sponsor’s last name:
[DAPUpline showField="last_name"]

To show affiliate’s/sponsor’s custom field (say “ssn”):
[DAPUpline showField="custom_ssn"]

More examples and details in the “Shortcode Details” section below.

 —————————————————————————————————————-

Shortcode Details

All of the shortcodes listed in the above “Shortcode Summary” section, are explained here.

Basic DAP Shortcode

[DAP]…private content…[/DAP]

This is the shortest version of the DAP Shortcode. In this version, anything you put between the [DAP] and [/DAP] tags, will be viewable only by a logged-in user.

No other restrictions for the content to be viewed, except that the viewer has to be logged in to your membership site (via DAP). So basically all free and paid members, regardless of which product they have access to, regardless of whether their product access is active or expired, can view the private content.

Full DAP Shortcode

[DAP hasAccessTo=”1,2,3″ errMsgTemplate=”SHORT”]…private…[/DAP]

This is the full version of the DAP Shortcode. All inner tagshasAccessTo and errMsgTemplate – are all OPTIONAL.

hasAccessTo: Comma-separated list of one or more Product Id’s that you want the user to have access to before they can view the content. So if you enter 3 different product id’s (like hasAccessTo=”2,7,14″) it means “Anyone with access to AT LEAST ONE of those products with the product Id’s 2, 17 or 14. It does NOT mean they have to have access to all of them at once. Access to any one is fine.

errMsgTemplate: This determines the HTML/text of the error message displayed, if user DOES NOT have access to the content being protected.

Values may be Can be SHORT, LONG or “” (empty). NOT mandatory. If omitted entirely from the tag, then the default template used is SHORT.

If you want no error message to be displayed, and want the protected content to silently disappear completely if user does not have access to it, then include the tag, but set it to “” (blank/empty), like this…

[DAP errMsgTemplate=””]…private…[/DAP]

The HTML/text displayed by the SHORT and LONG templates can be configured via the Setup > Templates screen, as shown below.

Examples

[DAP]...private content...[/DAP]

Viewable by Any Logged-in User

[DAP hasAccessTo="1" errMsgTemplate="SHORT"]...private...[/DAP]

Viewable by ANY logged in user (FREE or PAID – doesn’t matter) who is a user of the product with the ID “1” (you can get the Product id from the “Products > Manage” screen). Display HTML/text from the SHORT template if user does not have access to the private content.

[DAP hasAccessTo="1,2,3" errMsgTemplate="LONG"]...private...[/DAP]

Viewable by ANY logged in user (FREE or PAID – doesn’t matter) who has access to EITHER of the Products – 1, 2 or 3. Display HTML/text from the LONG template if user does not have access to the private content.

Member-Specific Content

“For Your Eyes Only”
Let’s say you run a coaching program. You have 10 clients. You want Joe Customer to see a tailor-made custom video meant only for Joe, and Jill Member to see a specific PDF report written specifically for Jill’s business. Now using the new “userId” parameter in the DAP shortcode, you can now protect a piece of content so that only a specific DAP user can see it.

[DAP userId="144"]protected content[/DAP]

In-Page Dripping

DAP Shortcodes now include the ability to specify a “Day” right within the shortcode itself. So you can now publish, say, 10 videos on one page, and you can enclose each video’s embed code with a separate DAP Shortcode that has a different “Day” setting, so the very same page will show 1 video on Day 1, 2 videos on Day 2, 3 videos on Day 3, and so on.

Like this…

[DAP day="1" hasAccessTo="1"]Video 1 Embed Code[/DAP] [DAP day="2" hasAccessTo="1"]Video 2 Embed Code[/DAP] [DAP day="3" hasAccessTo="1"]Video 3 Embed Code[/DAP]

NOTE: Please remember that you may not omit the hasAccessTo field – you must use the hasAccessTo field to specify a product id, because all start “days” for a user are associated with a product.

Hiding Content From Logged-In Members

Starting DAP v4.1, you can now mark content such that it will NOT be displayed to members who ARE logged in. To put it another way, it will HIDE content from members, and show it ONLY to NON-Members.

For example, this could be your sales copy or your buy-button, that you don’t want your logged in members (who may have already purchased the product) to see.

Here’s the shortcode for that.

[DAP isLoggedIn="N"]....content to show only to NON-members... [/DAP]

publicUntil

You can set a date UNTIL which a blog post is public (no protection or rules will be applied from any other shortcode parameters.
[DAP publicUntil="2012-12-31" hasAccessTo="1"]This message will be completely public UNTIL (and including) December 31st, 2012[/DAP]

publicAfter

You can set a date AFTER which a blog post will become public (no protection or rules will be applied from any other shortcode parameters.
[DAP publicAfter="2012-01-01" hasAccessTo="1"]This message will be completely public AFTER (and including) January 1st, 2012[/DAP]

hasNoAccessTo

A much requested feature. You can now specify a list of products that a user does NOT have access to, like this:
[DAP hasAccessTo="2" hasNoAccessTo="1,3" ]This message will appear only to active (current) users of product 2 but don't have access to 1 or 3[/DAP]

startday / endday

Now you can specify “startday” and “endday” in the shortcodes to make the contents stop being shown after a certain end “day”. Previously available “day” variable has been deprecated and replaced by “startday” instead. However, if you already are using it somewhere, it will continue to work as is. However, if you wish to use the “endday” variable, you must now also use “startday” instead of “day”. Very useful for, say, displaying a message on the Welcome page only on the first day.
[DAP hasAccessTo="2" startday="1" endday="1"]This message will appear to you only to users of Product 2, on Day 1 and no further[/DAP]

startdate / enddate

You can also specify actual dripping “dates” (instead of “days”) by using “startdate” and “enddate” in the shortcodes to make the contents stop being shown after a certain end “date”.
[DAP hasAccessTo="2" startdate="2012-01-01" enddate="2012-01-31"]This message will appear to you only to users of Product 2, on between the dates of Jan 1st, 2012 and Jan 31st, 2012 - and no further[/DAP]

Negative Days

“startday” and “endday” can also be a negative number.
For eg., [DAP hasAccessTo="2" startDay="-6" endDay="-3"]Howdy[/DAP]

This basically means, the message “Howdy” will be shown starting 6 days before the “Access End Date” of the user’s access to the product with Id “2” (specified in hasAccessTo). So you can use this to display a special message – or specially priced offer (buy button) – for those whose access has not yet expired. Last day (same day of access end date) is day 0. Day before that is -1.

Error Message From File

You can now specify a file name whose contents are to be used as error message. Use the existing errMsgTemplate field, but add a “file:…” to the beginning, and make sure the file name is a fully qualified URL starting with http:// and your domain name. So you can say…
[DAP hasAccessTo="2" startday="1" endday="1" errMsgTemplate="file:http://YourSite.com/customMessage.html"]This message will appear to you only today[/DAP]

[DAPUserLinks]

Allows you to heavily customize how the links are displayed when you use the merge tag %%USERLINKS%%

[DAPUserLinks showProductName="N" showAccessStartDate="Y" showAccessEndDate="Y" showDescription="Y" showLinks="Y" orderOfLinks="NEWESTFIRST" howManyLinks="10000" errMsgTemplate="SHORT" productId="ALL" dateFormat="YYYY-MM-DD"]

[DAPComingSoon]

Allows you to display links that are coming soon.

[DAPComingSoon showProductName="Y" showAccessStartDate="Y" showAccessEndDate="Y" showDescription="Y" showLinks="Y" orderOfLinks="NEWESTFIRST" howManyLinks="10000" errMsgTemplate="SHORT" productId="ALL" makelinksclickable="N" dateFormat="YYYY-MM-DD"]

[DAPUserProfile]

Allows you to selectively display profile fields on a page. Just set the profile field that you don’t want shown to “N” in the tag below.

Default is “Y”. So Leaving out the text showLastName=”Y” entirely from the shortcode, is the same as setting it “Y”, which means it will be displayed.

So just entering the text [DAPUserProfile] into a page, will show ALL fields.

And to not show say, Phone and Fax, you would do something like this:

[DAPUserProfile showPhone="N" showFax="N"]

So all other fields will be displayed, except those two.

[DAPUpline]
This shortcode shows a user their referring Affiliate’s (a.k.a Sponsor’s) information. So when a user visits the page that has this shortcode, it will display information of that user’s referring Affiliate – either from cookie (if exists), or if they’re already a member, then their current Affiliate’s information. And if neither the cookie is set, nor the user has an Affiliate attached to their account already, then it will show the info of the DAP Admin). So you can use it to show the user information of the person (affiliate) who referred them to the page. Think of it as a “Your Sponsor” tag.

To show affiliate’s first name, use this:
[DAPUpline showField="first_name"]

To show affiliate’s last name, use this
[DAPUpline showField="last_name"]

[DAPUpline showField="user_name"] [DAPUpline showField="email"] [DAPUpline showField="address1"] [DAPUpline showField="address2"] [DAPUpline showField="city"] [DAPUpline showField="state"] [DAPUpline showField="zip"] [DAPUpline showField="country"] [DAPUpline showField="phone"] [DAPUpline showField="fax"] [DAPUpline showField="company"] [DAPUpline showField="title"] [DAPUpline showField="paypal_email"]

For Custom fields…
[DAPUpline showField="custom_customfieldname"]

Click Here to Leave a Comment Below 54 comments
Veena Prashanth - February 29, 2016

Hi Etienn,

Please refer the “Error Message From File” section in this document.

You can set the errMsgTemplate to get content from a file.

For ex:

errMsgTemplate=”file:http://YourSite.com/customMessage.html

This way you can use html code to control font size.

Veena

Reply
Etienne Juneau, PhD - February 29, 2016

Love it! Thanks for the quick response.

Reply
Jason Richek - June 7, 2017

Is there a way to have content shown to members based on when they join? For example a member joins on 1/1 and has content on a page starting then, but another member who joins on 3/1 will only see content posted after their join date?

Reply
Veena Prashanth - June 7, 2017

Hi Jason,

That’s how content dripping works in DAP. The users that are on day 1 of membership will only be able to access content that has a drip day = 1. The users that are on day 1, cannot access content that’s set to drip on say day 7.

The content release is based on users membership life.

You can also use this shortcode :

[DAP hasAccessTo=”2″ startday=”1″ endday=”1″]This message will appear to you only to users of Product 2, on Day 1 and no further[/DAP]

Thanks,
Veena

Reply

Leave a Reply: