Domanda

Sto cercando di trovare un modo per caricare le pagine di un altro CMS in Magento. Stavo pensando di utilizzare una pagina CMS (forse bloccare pagina) che potrebbe ottenere il contenuto con PHP ... Ed è controllerei l'URL per vedere quale pagina di carico.

Quindi, come faccio a configurare Magento riscrivere in modo che ogni volta che viene caricata una pagina controlla se la pagina esiste in altri miei CMS se non che sarebbe tornato HTTP Not Found?

Sto anche pensando di utilizzare categoria per il collegamento.

È stato utile?

Soluzione

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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top