开发者

Integrating Drupal and WHMCS

I am just wondering if there is any 开发者_如何学运维hook to integrate WHMCS database with my existing Drupal site.

WHMCS has its own CMS and so as Drupal. I have used the same html twice for WHM and also for Drupal hence the problem is that I have to change twice if there is any design update.


The answer is no, there is no such thing.

A hook, in Drupal is not something magically to integrate anything. A hook is merely a architectual concept to allow code being ran on several occasions. A hook is not what you are looking for.

You will need to implement each and every piece of integration with Create, Read, Update, Delete synchronisation. A user in Drupal gets updated, that should fire code wich updates the data in your other CMS's database. A piece of content is created in your WHCMS, then it needs to become available in Drupal too. And so on and so on.

So, you will first need to define very clearly what you want to integrate and share between both. If it is only the session (single sign on) there are several solutions ready to use. But if you need all content, their comments, search-results and so on to be shared, you have a long way to go.

The reailty with integrating two CMS's entirely, is that you often need more then the sum of the codebase of both CMSs as gluecode: it needs such great amounts of complex integration and synchronisation-code, that in the same time you had probably written both Drupal and WHCMS from ground up. My advice: don't even try.


Hooks are mainly for CMS operations (creating/updating/deleting content). Sounds like you just need to share the theming from the CSS and header/footer HTML across both systems.

You can switch Drupal to use the Smarty template engine: http://drupal.org/project/smarty

You may then be able to create a Drupal theme that imports the header.tpl.php and footer.tpl.php from the WHMCS theme.

You may need to remove some of the Smarty markup and variables from the WHMCS side to simplify the header and footer to the point they can be used with Drupal (if you can make the header and the footer pure HTML, you may not even need to use Smarty on the Drupal side), or write a lot of preprocessing code on the Drupal side you may be able to populate the template variables with values from the WHMCS database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜