What you need to do to make the CMS template work on a regular website

The PHP content management system usually has its own template engine, whether smarty or some other custom template engine for this CMS. How can I get a CMS theme to work on a regular PHP website without converting the website to a website based on this CMS?

Can I "teach" a website to use the template engine of a content management system (only a template engine, not the actual cms engine and its functions)? My question may not be completely clear, but I'm sure that someone here knows enough about the mechanisms of templates to tell me the correct approach.

+3
source share
4 answers

It depends on the CMS system and templates used. Smarty can be easily implemented on a static site, so it would be easier to remove the CMS bits and replace them with content. In the case of Joomla, you can take the template files and delete the module code and replace it with content.

+3
source

If this is the case that you already have several pages that have been implemented using some kind of template system and want to use them without any changes, you should look at Twig or CMS with Twig support. (offspring of the Symphony project )

Twig allows you to write your own Lexer and Parser, you already have your own template syntax.

, Smarty Mustache , .

+2

15 , , , CMS. CMS - API CMS, , , API CMS. CMS.

P.S. , , , .

+2

HTML, , .

<div id="mainmenu"><?php echo $mainMenu ?></div>

..

PHP-.

+1

Source: https://habr.com/ru/post/1767293/


All Articles