Mage_Cms_Model_Preview_ProviderInterface
in
A module declares its provider under `global/cms/preview/providers/<entity>`, with the model alias in `<model>`, the ACL resource of the editor in `<acl>`, and the form field that holds the record id in `<id_field>`.
Tags
Table of Contents
Methods
- getStorefrontAction() : string|null
- The full action name of the storefront page that shows $draft, such as `blog_index_view`, or null when no storefront page shows it alone. The preview adds the layout handle and the body class of that action, so the theme styles the draft as on that page.
- getTargetHtml() : string
- The HTML that the preview shows for the target $block, from the $html it rendered.
- isTarget() : bool
- Tell if $block renders the content of $draft. The preview marks the output of that block, so the editor can keep the two panes on the same passage.
-
prepare()
: array{data: array
, warnings: list } - Turn the posted edit form into the data of a draft. Sanitize it as the save path does, so the preview shows what a save stores. A field that the save would refuse is left out, with a message in `warnings`.
- render() : bool
- Render the storefront page of $draft through $action. Return false when the page cannot be shown.
Methods
getStorefrontAction()
The full action name of the storefront page that shows $draft, such as `blog_index_view`, or null when no storefront page shows it alone. The preview adds the layout handle and the body class of that action, so the theme styles the draft as on that page.
public
getStorefrontAction(Draft $draft) : string|null
Parameters
- $draft : Draft
Return values
string|nullgetTargetHtml()
The HTML that the preview shows for the target $block, from the $html it rendered.
public
getTargetHtml(Mage_Core_Block_Abstract $block, string $html, Draft $draft) : string
Parameters
- $block : Mage_Core_Block_Abstract
- $html : string
- $draft : Draft
Return values
stringisTarget()
Tell if $block renders the content of $draft. The preview marks the output of that block, so the editor can keep the two panes on the same passage.
public
isTarget(Mage_Core_Block_Abstract $block, Draft $draft) : bool
Parameters
- $block : Mage_Core_Block_Abstract
- $draft : Draft
Return values
boolprepare()
Turn the posted edit form into the data of a draft. Sanitize it as the save path does, so the preview shows what a save stores. A field that the save would refuse is left out, with a message in `warnings`.
public
prepare(array<string, mixed> $post) : array{data: array, warnings: list}
Parameters
- $post : array<string, mixed>
Return values
array{data: arrayrender()
Render the storefront page of $draft through $action. Return false when the page cannot be shown.
public
render(Mage_Core_Controller_Front_Action $action, Draft $draft) : bool
Parameters
- $action : Mage_Core_Controller_Front_Action
- $draft : Draft