Shopware 6应用程序是否有预览模式?

huangapple go评论88阅读模式
英文:

Is there a preview mode for shopware 6 apps?

问题

有没有内置的解决方案用于在Shopware 6应用中进行预览?例如,我的应用程序显示消息,我希望商店所有者在全局激活消息之前可以在预览中查看这些消息。我该如何获得这种功能?
非常感谢您的帮助。

英文:

is there a built-in solution for shopware 6 apps to be previewed? For example my app shows messages and I want the shop owner to see the messages in a preview before he activates the messages globally in the shop. How do I obtain this functionality?
Thank you very much for help.

答案1

得分: 0

以下是翻译好的内容:

如果没有现成的解决方案。如果预览无需进行身份验证,只需广泛隐藏,那么您可以使用查询参数来决定是否显示消息,即使一般显示已关闭。

然后通知店主访问页面,该页面将使用previewEnabled查询参数显示消息:
http://shop.example.tld/some-page-with-the-message?previewEnabled

英文:

There's no such thing out of the box. If the preview doesn't have to be behind an authentication and may just broadly be hidden, then you could use a query parameter to decide on showing the message, even if the general display is turned off.

{% if config('MyApp.config.globallyActive') or app.request.query.has('previewEnabled') %}
   <p>My Message visible if globally active or preview is enabled</p>
{% endif %}

Then inform the shop owner to visit a page where a message would be shown using the previewEnabled query parameters:
http://shop.example.tld/some-page-with-the-message?previewEnabled

huangapple
  • 本文由 发表于 2023年3月15日 17:37:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/75742873.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定