如何在Magento中使用服务器端包含说明?

时间:2022-06-01 16:35:07

Has anyone found a way to get Server Side Includes to work inside a Magento product description?

有没有人找到一种方法让服务器端包含在Magento产品描述中工作?

I tried adding one and the published page did not show the content I'm trying to include.

我尝试添加一个,发布的页面没有显示我想要包含的内容。

For example, I added this to the product description field in the Magento Admin:

例如,我将其添加到Magento Admin中的产品描述字段:

<!--#include virtual="../test.php" -->

1 个解决方案

#1


3  

You're not going to be able to do that.

你无法做到这一点。

Magento product descriptions are stored in the database, and then PHP fetches them out and displays them

Magento产品描述存储在数据库中,然后PHP将其取出并显示它们

Server side includes are processed before Apache ever worries about outputing any content.

服务器端包含在Apache担心输出任何内容之前进行处理。

Magento doesn't have a feature that's similar to SSI. You could probably write an override to the Product class in Magento to acheive this effect, but it would be non-trival and beyond the scope of a simple * answer.

Magento没有类似于SSI的功能。您可以在Magento中为Product类编写一个覆盖来实现这种效果,但它不是简单的并且超出了简单的*答案的范围。

Good luck.

#1


3  

You're not going to be able to do that.

你无法做到这一点。

Magento product descriptions are stored in the database, and then PHP fetches them out and displays them

Magento产品描述存储在数据库中,然后PHP将其取出并显示它们

Server side includes are processed before Apache ever worries about outputing any content.

服务器端包含在Apache担心输出任何内容之前进行处理。

Magento doesn't have a feature that's similar to SSI. You could probably write an override to the Product class in Magento to acheive this effect, but it would be non-trival and beyond the scope of a simple * answer.

Magento没有类似于SSI的功能。您可以在Magento中为Product类编写一个覆盖来实现这种效果,但它不是简单的并且超出了简单的*答案的范围。

Good luck.