Partials are an often overlooked feature in Memberium used to help you manage your content.
Partials are chunks of content that can be included into multiple places on your site. They don’t have their own URL and don’t show up in menus or searches. You insert a partial by using a shortcode on another page or post. You can include partials anywhere that shortcodes can be processed.
Using Partials
The first step would be to create a new Partial. Go to Memberium > Partials and click on “Add New” to create a new partial. You can now give a name to the partial by entering a title and then in the visual editor, you can type in the content.
You can type in a Memberium shortcode, HTML, CSS, or anything else. The advantage of this is you can use the same partial on multiple pages and if any change is required, then you’d just need to edit the partial in one place, instead of editing it on all the pages.
As you can see in the above screenshot, the highlighted partial shortcode can then be copied and you can paste it in any page, post, or even menu items!
Bonus tip: You can also use Partials in menu items (in “URL” of custom link), and also in “Redirect URL” of Content Protection box. Adding it in Redirection URL would mean you can use partial as smart redirect.
Partials vs. Custom Shortcodes
Partials differ from Custom shortcodes in two important respects. Partials do not have their own individual shortcodes to insert them into the page. They all share a single shortcode. Because Partials don’t have their own individual shortcodes, they are lighter on the system then custom shortcodes. Partials can include other partials, or shortcodes, but they cannot dynamically render using attributes. Partials can be access controlled using tags and membership levels, like a regular page or post so they can be easily conditional.
Conditional Display
Whether or not a partials is displayed is based on the content access controls you assign to the partial. You can configure Partials that a visitor does not have access to, to be hidden or to display an excerpt.
Output Formatting
Partials are not automatically subject to automatic WordPress formatting such as auto-paragraphs and texturization, making them useful for JavaScript or CSS content.
Common Uses of Partials
Partials are a simple but very useful tool in your membership tool belt. Here’s some of the things you can do with them:
- Re-use the same content in multiple locations throughout your site that can be updated in one place.
- Conditionally display a section of content on the page
- Break a long piece of complex HTML or page content into manageable pieces
- Embed complex HTML or shortcode content for use in a theme or plugin widget with HTML restrictions.
- JavaScript or CSS snippets
Some examples of displaying conditional content on the page would include but are not limited to:
- Deliver visitor-specific content within a particular page, for example a welcome video for new members
- Featured site content
- Displaying targeted ads to for additional access and upgrade offers
- Display targeted partner ads to customers / members