You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Carbon Fields offers the option to disable or enable the preview mode, currently there is a limitation if you wish to display content while keeping the preview mode active. Presently, achieving this requires manually calling settings and setting the mode to preview. Here's an example:
As seen above, the preview mode is enabled by default with an option to switch to edit mode.
One possible enhancement could be achieved by adding a new preview_edit array in the mode_map. This would allow for preview mode to be enabled by default while still providing the option to switch to edit mode.
protected $mode_map = array(
'both' => array(
'mode' => 'edit',
'preview' => true,
),
'edit' => array(
'mode' => 'edit',
'preview' => false,
),
// this disable preview button with preview mode on
'preview' => array(
'mode' => 'preview',
'preview' => false,
),
// preview mode on by default but we can switch to edit mode
'preview_edit' => array(
'mode' => 'preview',
'preview' => true,
),
);
It's worth noting that this approach may have drawbacks, such as initially not displaying anything when blocks load for the first time. Possible solutions to mitigate this could include adding an initial load only for the editor or utilizing CSS to add a placeholder.
The text was updated successfully, but these errors were encountered:
Version
this is not an issue but a suggestion.
While Carbon Fields offers the option to disable or enable the preview mode, currently there is a limitation if you wish to display content while keeping the preview mode active. Presently, achieving this requires manually calling settings and setting the mode to preview. Here's an example:
As seen above, the preview mode is enabled by default with an option to switch to edit mode.
One possible enhancement could be achieved by adding a new preview_edit array in the mode_map. This would allow for preview mode to be enabled by default while still providing the option to switch to edit mode.
It's worth noting that this approach may have drawbacks, such as initially not displaying anything when blocks load for the first time. Possible solutions to mitigate this could include adding an initial load only for the editor or utilizing CSS to add a placeholder.
The text was updated successfully, but these errors were encountered: