magento:使用magento渲染引擎渲染外部html
我是 Magento 的新手, 目前我正在研究一个项目的可行性。我想做的是使用外部 CMS 来管理 magento 中的布局、块和菜单。我们以 drupal 为例。
我见过一个名为 drupento 的模块,它集成了 drupal 和 magento。不幸的是我还没有成功地让它发挥作用。该模块将 html 片段存储在文件系统中,magento 渲染这些块。 那么我想知道的是:
如何使用 magento API 来使用这些功能?
有哪些限制以及我们可以做什么和不能做什么?
对此有什么想法吗?
问候
I'm a newbie at Magento,
Currently I'm studying the feasibility of a project. What I want to do is to use an external CMS to manage layouts, blocks and menusin magento. Let's take drupal as an example.
I have seen a module that does the same thing called drupento which integrates drupal and magento. Unfortunately I haven't succeeded to make it work. This module stores the html fragments in the file system and magento renders these blocks.
So what I want to know :
How to use these features using magento APIs ?
What are the limits and what can we do and what we can't?
Any idea about that ?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法具体与 Drupal 交谈,但既然您一般性地询问了另一个 CMS,我会回答这个问题。由于 Magento 页面是以模块化方式构建的,因此您绝对可以用其他地方生成的页面替换页面的块。一般方法如下:
您是否希望 Magento 还是其他 CMS 缓存块内容取决于您,但您可能应该只允许其中之一这样做。
由于您的块可以调用任意 PHP,因此 Magento 端不应有太多限制。您可能希望确保您使用的任何 CMS 都可以呈现单个内容块,而不仅仅是整个页面。
请记住,您可能无法从 Magento 中调用其他 CMS 的本机函数(尝试在 Magento 中使用 Wordpress 的 theLoop,哈!),而是 Magento 会消耗其他 CMS 中的内容块,就好像它一样是一项服务。这是因为每个系统使用的框架通常是互斥的。
希望能澄清一些事情!
谢谢,
乔
I can't speak to Drupal specifically, but since you asked generically about another CMS, I'll answer to that. Since Magento pages are built out in a modular way, you can absolutely replace chunks of the page with ones generated elsewhere. The general approach would be something like this:
It's up to you whether you want Magento or the other CMS to cache the block contents, but you should probably only allow one or the other to do so.
Since your block can call arbitrary PHP, you shouldn't have many limitations on the Magento side. You may want to make sure that whatever CMS you use can render single blocks of content, and not just the entire page.
Keep in mind that you probably won't be able to call native functions from the other CMS from within Magento (try using Wordpress' theLoop in Magento, ha!), but rather Magento will consume blocks of content from the other CMS as if it were a service. This is because of the usually mutually exclusive frameworks that each system uses.
Hope that clarifies things a bit!
Thanks,
Joe