Buy B2BKing
$199 $149
B2BKing's content shortcode can be used to show different content to different user categories, groups or individual customers, restricting who can view the specific content you place inside the shortcode.
Here are a few examples of what can be done with this shortcode:
Note: The content restriction shortcode can be used anywhere: pages, product descriptions, as well as any custom elements or widgets that support shortcodes.
Usage Example
[b2bking_content show_to=b2b]Only B2B users can view this content...[/b2bking_content]
The parameter show_to is mandatory and controls who can view the specific content within the shortcode. This parameter can contain multiple items, comma-separated. The parameter supports 6 options:
More examples:
[b2bking_content show_to=b2c,loggedout,admin]Only B2C users, logged out users, and the user "admin" will see this content.[/b2bking_content]
[b2bking_content show_to=123,b2c,loggedout,admin]B2B users in the group with ID 123, B2C users, logged out users and the user admin will see this content.[/b2bking_content]
[b2bking_content show_to=123,14,88]Only B2B users in groups 1234, 14 and 88 will see this content[/b2bking_content]
[b2bking_content show_to=bought1234]Only users who purchased the product with ID 1234 can see this content. This can be used to lock specific content under a paywall.[/b2bking_content]
Let's see what this look like when working with an actual page.
The above example shows a page where we have different content for B2B and B2C or logged out users.
When viewing the page as a logged in B2B user, the page looks like this:
When viewing the page as a logged out user, the page looks like this:
While the content restriction shortcode deals with the actual content inside the page, another common situation is needing to apply CSS (and specific design changes) for particular users or groups only. This can be achieved through group-specific CSS.
B2BKing adds classes to the body tag, that can be used to target specific groups only:
The classes you can use are:
Example
Hide a menu items for logged out users only by adding this CSS:
.b2bking_logged_out #menu_item{ display:none; }
Example 2
Show a different background color for B2B and B2C users
.b2bking_b2b_user body{ background:blue; } .b2bking_b2c_user body{ background:green; }
Powered by BetterDocs