سؤال

I am trying to find a way to load pages from another CMS into Magento. I was thinking of using a CMS page (maybe block page) that could get the content with PHP... And it would check the URL to see which page to load.

So how do I configure Magento rewrite so that every time a page is loaded it checks if the page exists in my other CMS if not it would return HTTP Not Found?

I am also thinking of using category for the link.

هل كانت مفيدة؟

المحلول

This is best done building an extension that retrieves pages for you. Using this extension you can then connect to an external database. (I've never used it myself so please test it first)

When a url is requested extend the Magento frontend controller (this might help) and first check if that URL exists in the external database, if not do nothing, else you can use your controller to load a page and request the page content from the database.

Another way would be to extend the Magento native CMS pages, making sure that all pages in your external database also have their counterpart at least with URL key in the local Magento database. Then when the Mage_Cms extension wants to load a CMS page overwrite the models to retrieve it externally.

The last one might be a nicer solution than the first one as it has less impact on the whole codebase

نصائح أخرى

The safest way (but not that easy) in my opinion is to migrate the pages from your CMS to your magento instance in the pages table. You can build some custom functionality on your cms that copies the page on save to your magento instance.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top