Blocks & Shortcodes

Every block, shortcode and link, in one place

A reference for placing Allspice elements exactly where you want them.

Overview

The Allspice plugin adds blocks to the WordPress editor, plus shortcodes for places blocks can't go: the classic editor, theme templates, page builders, and widget areas.

You don't need any of these for the standard setup, because the plugin places the widget and rail automatically. Use them when you want a specific element in a specific spot.

TIP:

Where a block and a shortcode do the same job, prefer the block. It previews in the editor, and it will not be left behind as visible text if the plugin is ever deactivated.

Blocks

Search for “Allspice” in the block inserter, or type /allspice in the editor. Every block name starts with “Allspice”.

BlockWhat it places
Floating ButtonThe floating Allspice launcher, on the post it's placed in. Overlay style only: it renders nothing when either device uses the Floating or Inline style.
RailThe classic Allspice rail, with its suggested-question bubbles. Overlay style only, like the Floating Button; the Floating and Inline styles use the adaptive rail instead.
Inline overview, style 1 & 2Two visual treatments of the recipe overview block.
Inline cooking CTAA call to action that opens guided cooking for the recipe on the page.
Inline save recipe formA save-this-recipe prompt, inline in the post.
Inline newsletter formA newsletter signup that feeds your connected email provider.
Meal PlansYour meal plan products, purchasable in place. Set an optional heading and subtitle in the block settings.
Meal Plan FeatureA sales section for one meal plan. Paste the plan's Product ID from the Publisher Portal into the block settings. The headline, description, and button label default to the plan's own name, description, and “View this plan”; you can override each, and turn the price and plan facts (days, meals) on or off. With no Product ID, the block shows nothing on your site.
Membership CTAA membership call to action with your live pricing and benefits. Renders on the server, so it is present for crawlers.

Shortcodes

Paste these anywhere shortcodes run. Shortcodes render nothing while the front end is turned off in Settings → Allspice → Status & Debug.

ShortcodeWhat it places
[allspice_button]A button from your Button library. [Allspice_Button], the form the Publisher Portal copies, does the same thing.
[allspice_floating_button]The floating launcher. Overlay style only, like the Floating Button block.
[allspice_inline_chat]Pico chat, inline in the content.
[allspice_inline_search]A search box inline in the content.
[allspice_search]The full search experience. This is what the Advanced Search page uses.
[allspice_inline_cooking_cta]The guided-cooking call to action.
[allspice_inline_overview_style_one]Recipe overview, first style.
[allspice_inline_overview_style_two]Recipe overview, second style.
[allspice_membership]The membership landing content. Kept working for pages generated by earlier plugin versions; new membership pages use editable blocks instead.

Shortcode attributes

All attributes are optional. Sizes are in pixels.

[allspice_button]

AttributeWhat it does
idThe button ID from your Button library, for example WIDCON-t7ab. Required: without it the shortcode renders nothing.
reserve_w, reserve_hSpace held for the button while it loads, so the page doesn't shift. Premade buttons fill in their own defaults if you leave these out.
classExtra CSS class on the button's slot.
flow1 makes the slot full width (capped at reserve_w) and centered, instead of a fixed-size inline box.

[allspice_floating_button] also takes id, reserve_w, and reserve_h, plus:

AttributeWhat it does
offset_right, offset_bottomDistance from the right and bottom of the screen. Default 20 each.
zThe launcher's z-index. Default 9000.

Inline shortcodes ([allspice_inline_chat], [allspice_inline_search], [allspice_inline_cooking_cta], and the two overview shortcodes) take id, reserve_w, and reserve_h. All but [allspice_inline_chat] also take class, an extra CSS class on the wrapper. The cooking CTA and overview shortcodes also take pad_top and pad_bottom: space above and below, 0 to 200, default 16. The matching blocks have the same spacing settings.

Often you do not need a block at all - you need an ordinary link that opens Allspice. Use these as the href on any button, menu item, or email link. The plugin opens the right screen in place, without loading a new page.

LinkOpensWorks
#allspice-membershipMembership signup and pricingAny page
#allspice-loginSign-inAny page
#allspice-accountThe reader's account and billingAny page
#allspice-searchSearch. Accepts a query: #allspice-search?q=chickenAny page
#allspice-mealplansThe meal plan storeAny page
#allspice-recipeThe Allspice widget for this recipeRecipe pages only
#allspice-saveSave this recipeRecipe pages only
#allspice-groceriesAdd this recipe to groceriesRecipe pages only
#allspice-guided-cookingGuided cooking for this recipeRecipe pages only
TIP:

The recipe-page links act on the recipe being viewed, so they do nothing on a page with no recipe. The other five work anywhere the plugin is active.

You can also deep-link a specific meal plan product by appending its id: #allspice-mealplans-prod_XXXX. The portal gives you the full link for email campaigns.

Troubleshooting

A shortcode is showing as text on the page

The plugin is inactive, or the shortcode name is misspelled. Check the spelling against the table above. ([allspice_button] and [Allspice_Button] both work; other shortcodes are lowercase only.)

A block renders in the editor but not on the site

Check these in order:

  • The Floating Button and Rail blocks (and [allspice_floating_button]) render nothing when either device uses the Floating or Inline widget style. That's expected.
  • The front end is turned off in Settings → Allspice → Status & Debug.
  • A JavaScript optimization plugin is delaying Allspice. See Plugin compatibility for the exclusions to add.

A recipe-scoped element does nothing

Confirm the page has a recipe Allspice can parse. See Recipe parsing.

A link hash does nothing

  • Confirm the plugin is active on that domain
  • Check it against the table above - some routes are recipe-page only