英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论