mycred_all_scratch_cards

Codex / mycred/game / Shortcodes / mycred_all_scratch_cards

Description

This shortcode will render all active scratch card sets that you currently have installed on your website. Logged in users can then buy a card via this shortcode. Unlike the mycred_scratch_cards shortcode which will only show one particular card set, this shortcode will show multiple.

This shortcode is unique and can only be used once per page. Requires the Scratch Cards add-on to be installed and enabled.

Available since version 1.1

With multiple cards being shown, you might need to add some CSS styling to the page where the shortcode is used.

Shortcode Attributes

Attribute Type Required Default Description
user_id int or string No - Option to set the requirement for a particular user. Should not be used unless you must check a different user, than the one viewing the shortcode.
theme string No gold Color theme to use. Available values are: plain, inverse, blue, green, gold, red and purple
show_balance int No 1 Option to show a users current balance in the play field. Use 1 to show or zero to hide.
balance_label string No "Your Balance:" The balance label to use. Set this to empty to hide.
height int No - The height of the play field. By default it will use the height of the card. Can either be a pixel value e.g. 100px or a percentage value e.g. 50%.
padding int No 20 Optional padding inside the play field. Should be a numeric value without px or %. If you set width to be 100%, the padding will not be applied to the left and right side of the play field!
bgcolor string No #f1f1f1 Play field background color.
ctype string No MYCRED_DEFAULT_TYPE_KEY The point type to display, if you select to display a users balance.

CSS Styling

// Playfield wrapper
.mycred-play-field-wrapper { }

// Top Bar
.mycred-play-bar { }

Examples

Example 1: Default usage.

[mycred_all_scratch_cards]

Example 2: Hide balance.

[mycred_all_scratch_cards show_balance=0]

Example 3: Show balance but remove the balance label.

[mycred_all_scratch_cards balance_label=""]

Example 4: Change the theme.

[mycred_all_scratch_cards theme="plain"]

Last edited June 23, 2016