教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 工作中的几个Drupal小问题记录总结

工作中的几个Drupal小问题记录总结

发布时间:2016-12-01   编辑:jiaochengji.com
教程集为您提供工作中的几个Drupal小问题记录总结等资源,欢迎您收藏本站,我们将为您提供最新的工作中的几个Drupal小问题记录总结资源
以下是最近工作中总结的几个Drupal小问题,Drupal性能模块之简明分析对比,实现view动态输出的步骤方法,为Drupal主题添加主题内自带图片的正确方法。其中第一个是在网上找到的翻译国外内容,这此感谢这些默默翻译的高手。

Drupal性能模块的简明分析对比

原文:

Varnish

We explored various caching solutions available for Drupal. We shortlisted Varnish, Boost and Authcache modules. We performed a number of tests using these modules. We tested over 1000 pages from different locations. The average page load time without any caching was above 4.0 seconds. The average page load time with Drupal's default caching was 2.5 seconds. The average page load time with the Authcache module was reduced to 1.8 seconds. The average page load time with the Boost module was 1.7 seconds. The average page load time with Varnish module was 1.5 seconds. Therefore we preferred using the Varnish module. These stats are for this site only, the results may vary for other sites.

我简单翻译下:

用1000个不同的页面作的测试,

1.不用任何缓存模块:平均加载时间4秒以上;
2.使用drupal自带缓存:平均加载时间2.5秒;
3.使用Authcache模块,平均加载时间1.8秒;
4.使用Boost模块,平均加载时间1.7秒;
5.使用Varnish模块,平均加载时间1.5秒;

-----------------------------------------------

实现view动态输出的步骤方法

1、在 view 的属性页,选择 header
2、选择 Global: Text area
3、在弹出框里,覆写 输出
4、只有Replacement patterns 显示出来的字段,才能被调用
5、注意勾选 *Use replacement tokens from the first row

-----------------------------------------------

为Drupal主题添加主题内自带图片的正确方法

在为drupal的主题添加主题自带的一些图片的时候,会碰到一些路径问题,使用下面这些方法添加的图片,才能正确显示在页面上:

<img src="<?php print $base_path . drupal_get_path('theme', 'yourtheme');?>/image/act-title.jpg">

在php标签里面输出url的时候要使用 $base_path 与 主题路径拼接出来的url 然后再加上主题目录里面的静态图片的路径,才能正确的显示.

您可能感兴趣的文章:
工作中的几个Drupal小问题记录总结
专家教你如何有效的学习Drupal - Drupal问答
强大的Drupal有什么缺陷与不足?
Drupal配置迁移详细讨论
Drupal的缓存技术应用-让你的网站飞起来
Drupal 7结合Apache Solr 4.7实现中文分词教程
Drupal7配合Varnish使用及整合drupal模块的详细教程
drupal7连接多个数据库问题解析
Drupal中如何配置及利用Memcache的hash策略
Drupal7 cache缓存开发入门教程

[关闭]
~ ~