单独的促销网站

发布于 2024-10-07 15:47:14 字数 278 浏览 3 评论 0原文

我正在使用 Kohana 框架用 PHP 构建一个项目。它最终将支持多个用户,因此有一个登录屏幕等。我还有某种“促销网站”,它可能会告诉您该产品有多好,并且有帮助页面和常见问题解答等。

我的问题是:将我的项目和推广网站作为单独的网站(例如,推广网站在单独的目录中使用 Drupal 之类的东西)有哪些(缺点)优点?另一种方法是使用 Kohana 将页面构建为我的项目的一部分。在同一主机的不同目录中拥有两个独立的框架(Drupal 和 Kohana)效果如何? (我喜欢使用 Drupal 的所有东西来处理帮助页面的内容等)。

I'm building a project in PHP, using the Kohana framework. It will eventually have support for multiple users, so a login screen, etc. I also have some kind of "promotion site", which will probably tell how good the product is, and have help pages and a FAQ, etc.

My question is: what are the (dis)advantages of having my project and the promotion site as separate sites, for example the promotion site using something like Drupal in a separate directory? The alternative is building the pages as a part of my project, using Kohana. How well does having two separate frameworks work (Drupal and Kohana), in probably different directories in the same hosting? (I like the idea of having all of Drupal's stuff for doing the content of the help pages, etc).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囚你心 2024-10-14 15:47:14

如果 drupal 的东西在不同的文件夹中,那么它实际上根本不会影响 kohana。单独的文件夹也可以,单独的文件夹。您还可以将其放在 help.example.com 等子域中。无论你喜欢什么,应该不是问题。我使用 WordPress 博客,我的主要网站是 Kohana。

If the drupal stuff is in a different folder, then really it should not affect kohana at all. Seperate folders act as well, separate folders. You could also put it on a subdomain like help.example.com. Whatever you like, should not be a problem. I use a wordpress blog with my main site being Kohana.

黑凤梨 2024-10-14 15:47:14

从长远来看,拥有单独的内容/定制开发站点可能会导致更多的工作。每次在 Drupal 上更新主题时,您也需要在 Kohana 项目上更新它。此外,也许将来您将需要更多的集成 - 例如,您可能希望某些页面仅对登录的用户可见。

对于这种情况,我通常会为网站的内容部分开发一个非常基本的 CMS。这并不是一项太大的任务 - 制作一个“CMS”模块,以便您可以在其他项目中重用您的代码。创建“页面”表和模型来存储页面。使用TinyMCE或类似的页面编辑界面。

在 CMS 模块的 init.php 中,您可以创建一个循环来遍历所有页面并为它们创建路由(这些将在默认的/路由之前进行检查)

<?php
$pages = Model::factory('page')->find_all();
foreach($pages as $page){
    Route::set('page_'.$page->id, $page->uri)
        ->defaults(array(
            'controller' => 'pages',
            'action' => 'display'));
}

如果您只想如果您自己编辑内容页面,您可以跳过整个页面编辑界面,只编辑数据库中的原始 html。不像 Drupal 那样优雅,但是您将拥有更紧密的集成,并且可以避免 Drupal 带来的臃肿。

Having separate sites for content/custom development will probably end up more work in the long run. Every time you update the theme on Drupal, you'll need to update it on your Kohana project too. In addition, maybe in the future you will need more integration - for example you may want certain pages to be visible only by users who are logged in.

For situations like this I usually develop an extremely basic CMS for the content part of the site. It's not too big a task - make a 'CMS' module so you can reuse your code in other projects. Create a 'pages' table and model to store the pages. Use TinyMCE or similar for the page editing interface.

In the CMS module's init.php, you can create a loop which goes through all the pages and creates routes for them (these would be checked before the default <controller>/<action> route)

<?php
$pages = Model::factory('page')->find_all();
foreach($pages as $page){
    Route::set('page_'.$page->id, $page->uri)
        ->defaults(array(
            'controller' => 'pages',
            'action' => 'display'));
}

If you're only going to be editing the content pages yourself, you could skip the whole page edit interface and just edit the raw html in the database. Not quite as elegant as Drupal, but you'll have much tighter integration and you'll save yourself the bloat that comes with Drupal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文