欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal

shiping1 的头像

给drupal 单独页面配置主题

我做的drupal6的例子
//自定义的主题
function shipingzhongcustom_init() {
  global $user, $custom_theme;
  // Set all node pages (including the node itself, as well as pages for
  // editing it, deleting it, etc.) to default to using the 'some_theme'
  // theme, rather than the site's normal default theme.
  if(arg(0) == 'user'){
      $custom_theme = 'garland';
      
  }
}



Drupal 6.x:

普通分类: 
shiping1 的头像

drupal 自定义主题

function hook_custom_theme

7 system.api.phphook_custom_theme()
普通分类: 
shiping1 的头像

根据路径不同使用不同的主题

Change Drupal Theme Based On URL Path

You could spend 9 years looking for a module to do it or you could do this. Put this in your settings.php

$THEME_URLS = array(
	array('/admin','garland'), # Drupal already support admin theme anywho
	array('/users','fancy_user_theme'),
	array('/forum','forums_theme'),
	);
foreach ( $THEME_URLS as $info)
	if ( strpos($_SERVER['REQUEST_URI'],$info[0])===0)
		$conf['theme_default'] = $info[1];


http://mattshaw.org/news/change-drupal-theme-based-on-url-path/
普通分类: 
shiping1 的头像

maintenance-page.tpl.php这种文件是干什么用的呢? 网站维护状态的模板文件

maintenance-page.tpl.php这种文件是干什么用的呢?


赞成!
0
否决!

维护页的界面,当后台选择维护后,网站就会关闭所有前台页面,只能看到这个界面。
来自 http://www.drupalla.com/node/2694

普通分类: 
shiping1 的头像

覆写默认样式的各种方法

覆写默认样式的各种方法

  除了利用CSS,还有多种方法可实现对Drupal默认样式的覆写。其中每一种方法各有利弊,因此你,作为主题开发人员,需要决定哪一种方法是最适合你的。

方法如下:

普通分类: 
shiping1 的头像

drupal中覆写可主题化的输出

drupal中覆写可主题化的输出

原文:http://drupal.org/node/173880
译者:葛红儒,    Think in Drupal
只有当你需要修改默认输出时,你才需要阅读本节.如果你的显示层是完全有CSS样式表负责的,那么可以略过本节。
覆写主题输出,需要掌握3个方面。首先,你需要知道源头在哪里,其次你要进行覆写,最后你需理解它的类型。
注意,Drupal使用主题注册表(theme registry)来缓存主题数据覆写完成后,你必须清空缓存。
 
1.       寻找源头:
寻找主题输出的源头,是比较困难的,这是由于主题系统的多层级结构造成的,使得源头可能出现在系统的各个地方。
普通分类: 
shiping1 的头像

drupal定制用户页面

drupal定制用户页面 不指定

drupal水滴 , 2012/05/26 23:58 , drupal建站 » drupal主题 ,
普通分类: 
shiping1 的头像

Drupal 6 自定义用户登陆、注册页面

Drupal 6 自定义用户登陆、注册页面

(2011-07-15 09:33:27)
标签:

普通分类: 
shiping1 的头像

Drupal主题开发

Drupal主题开发

分类: Drupal 262人阅读 评论(0) 收藏
普通分类: 
shiping1 的头像

给用户添加自定义的图像字段 image picture

shiping1 的头像

关于Drupal程序开发中的drupal_render方法简介

shiping1 的头像

Drupal 7 通过 render 读取 图片字段。

shiping1 的头像

autocomplete text field invalid widget.

autocomplete text field invalid widget.
安装 autocomplete_widgets 模块
在设内容类型 的字段设置里
普通分类: 
shiping1 的头像

drupal ubercart 自己学习3

Drupal Ubercart 2.X 商城模块基本用法视频教程

1 UC安装
先安装imagefield然后安装ubercart中的product,这样安装product时会自动为product内容类型添加imagefield字段。否则没有这个字段。
2 基本配置
商城管理--购物车基本设置包括名称、显示方式、区块名称设置;
        --商品分类基本设置;
        --付款基本设置;
        --订单基本设置;
        --商品基本设置;

3 商品分类及属性详细设置
        --创建商品分类及子类也即添加分类术语
        --允许用户添加关键字
        --发布商品
        --发布商品套餐包
        --从文本文件批量导入商品(下载node import模块,创建CSV文件,内容管理→导入内容→基本配置后即可)
        --创建商品属性(开启attribute模块→创建color及memory属性→为每个属性创建具体选项→为具体的每个商品做设置→OK)

普通分类: 
shiping1 的头像

node 变量 page变量 等 自己动手开发主题

1) $picture 作者的头像
2) $page==0 是否是page ,判断 当前节点的页面是完整的页面 还是在列表中显示
3) $content 变量 就是整理过后 要输出的内容 它是整个内容(组装好了的)

4)$links          <?php dsm('$links'); ?>
function lugir_links($user){
    return '';
} 用这种方法来重写$links变量
5) $display_submitted: 是否显示提交信息
$date: 创建时间.

$name: 作者名通过 theme_username()处理输出.

$node_url:节点链接

$display_submitted: 是否显示提交信息.
$term 分类 此节点属于哪个分类

$submitted:提交信息 $name 和 $date 在template_preprocess_node().

$classes:用于css,会显示下面的结果:

普通分类: 
shiping1 的头像

主题函数 主题钩子函数

<?php if (!empty($secondary_links)): ?>
          <div id="secondary" class="clear-block">
            <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')); ?>
          </div>
     <?php endif; ?>

这里好像是 只能在page.tpl.php文件中才会起作用


1)在 sites/all/modules/中
  建一文件夹 hellodrupal
2)在其内建 hellodrupal.info,hellodrupal.module
名称要一样
 <?php
; $Id$
name = Hellodrupal
description = List the latest content links
core = 6.x

普通分类: 
shiping1 的头像

jQuery Msg Alert 的使用

jQuery Msg Alert

This module displays Drupal's messages and the most recent Watchdog's messages as a little alert at the bottom corner. Every message sent by drupal_set_message() will be converted to a dialog alert, using jQuery Msg Alert plugin.
You can configure the time interval between then and they will reorganize themselves to be always near each other.
These alerts are actually jQuery UI dialogs, so you have a huge option of themes to customize the look and feel.

REQUIREMENTS:
普通分类: 
shiping1 的头像

TypeError: $(...).on is not a function drupal的jquery版本有时低出问题

你可能要添加您的安装的更多细节进入正题。
普通分类: 
shiping1 的头像

error "An error occurred at /admin/build/views/ajax/display/home/default/analyze-theme"

不知道什么原因 反正 把misc下的jquery.js 文件换掉 就可以了
反正jquery核心文件有时一动 就会出点问题
普通分类: 
shiping1 的头像

views 用sql来查询

普通分类: 
shiping1 的头像

根据node得到路径

见 https://drupal.org/node/164585 有大用
变量 $node_url 只有在node.tpl.php中起作用


<?php
$nodeurl
= url('node/'. $node->nid);
普通分类: 
shiping1 的头像

drupal 路径 别名路径

我的方法 根据$term得到 别名路径
<?php   $pathArr=taxonomy_term_uri($continent);$alias= drupal_get_path_alias($pathArr['path']); ?>
这里 alias 就是别名路径


Get the URL of a Node or Term in Drupal 7

Primary tabs
ListView(active tab)
Submitted by geoff on Sat, 2012-04-28 11:33
Given a Node or Taxonomy Term - or any "entity" based object

$uri = entity_uri($entity_type, $entity);
$url = $uri['path'];
When you create a link with the l() function, it will link to the Clean URL for that entity (if one exists).

for a Node
普通分类: 
shiping1 的头像

开发时 每次都要清空缓存的办法


admin/build/themes/settings/lanyulu
(好像是只有zen或zen子主题下才可以看到下面)
下面这个页面的设置



Theme development settings


普通分类: 
shiping1 的头像

drupal 错误弹出js alert

  这个模块 可以实现 错误弹出js alert
可以让错误信息更友好

好像没有配置,装上去就起作用

可是对所有页面都起作用

普通分类: 
shiping1 的头像

Drupal 7与Drupal 6比较之主题变化

shiping1 的头像

自己通过模块创造主题里的预处理函数

shiping1 的头像

drupal 不能对评论进行回复 不能回复评论 去掉评论回复

删除Drupal评论中的Reply链接

作者:老梁 日期:2013年5月12日

删除Drupal评论的reply链接

在有些Drupal网站建设项目中,客户希望禁用评论项的回复功能。实现这个需求非常简单,通过实现THEME_preprocess_comment()主题预处理函数即可。

在Drupal主题的template.php文件中,放入下列代码:

普通分类: 
shiping1 的头像

drupal节点或评论中显示用户头像

Enabling user pictures (avatars)

Last updated April 8, 2012. Created by emmajane on May 7, 2005.

普通分类: 
shiping1 的头像

有人用过ubercart吗 请问原价 现价 的方法

有人用过ubercart吗 请问原价 现价 的方法
如何实现
原价的字段 怎么办
是在内容类型里添加字段吗
[福建]Lenny(112331868)  21:54:05
原价就是list price
打折就是sale price
[苏州]泪痕_元怜(958186957)  21:54:29

cost是什么意思吗
[福建]Lenny(112331868)  21:54:46
安装完über cart 自然会有个product content type
 
[苏州]泪痕_元怜(958186957)  21:55:24
product content type
 可以在内容类型中设吗
设字段吗
因为感觉字段不够用
@[福建]Lenny   兄弟可以吗
我是说增加字段 怎么加
[中山]猫之良品<catcat811@gmail.com>  22:11:02
cost就是成本的意思
普通分类: 
shiping1 的头像

drupal 翻译字符串几种方法 有大用

1)
http://my.wangruo.com/admin/build/translate/
admin/build/translate/search

2)装上stringoverride ( string override )模块后  可以自定义增加字符串 并进行翻译,,,还可以导入导出字符串设置
admin/settings/stringoverrides

3)直接在 .po文件中修改 和增加
themes/chameleon/translations/themes-chameleon.zh-hans.po

普通分类: 

页面

Subscribe to RSS - drupal