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

这里的技术是共享的

You are here

drupal

shiping1 的头像

drupal6 调用的主题函数:

drupal6 调用的 theme 函数


drupal6 调用的主题函数:

 

普通分类: 
shiping1 的头像

theme主题 学习

上次我们说的page.tlp.php 就是负责排版的
这个node.tpl.php文件主要是输出content,比如文字列表
1)phpTemplate 安装在 themes/engines 目录下

php主题包含的文件
1)example.info文件
主题的注册文件 让drupal发现
name = MyGarland  ;主题名称
description = Tableless, recolorable, multi-column, fluid width theme (default).
version = VERSION
core = 6.x
engine = phptemplate
stylesheets[all][] = style.css
stylesheets[print][] = print.css

; Information added by drupal.org packaging script on 2012-02-29
version = "6.25"
project = "drupal"
datestamp = "1330534547"
普通分类: 
shiping1 的头像

Poedit教程_po和pot文档

Poedit 基础教程

作者:TeliuTe 来源:基础教程网

一、po 和 pot 文档 返回目录 下一课

 po文件用于多语言程序,可以很方便地把程序翻译为本地语言,下面我们来看一个练习;

 1、po 文件

 1)po 文件可以在程序源代码中找到,或者从一些本地化翻译网站上下载;

 

 

 2)用文本编辑器打开后,可以看到里面是文本,开头一般是名称、日期、地区等描述;

 

 

 3)再往下就是具体的词条内容,一般至少有两行,一行是英文,下一行是翻译后的本地语言,都用英文双引号括起来;

 

 

 4)带 # 开头的一行是注释,这句不用翻译,用来定位词条的,

 msgid " 开头的一行是原文,双引号里面是要翻译的词条,

 msgstr " 开头的一行是译文,双引号里是翻译的内容,双引号是英文的,

 #, fuzzy 表明这个词条是模糊翻译,删除这一行后,就是确定翻译;

 
普通分类: 
shiping1 的头像

drupal 一些主题函数

http://api.drupal.org/ 里面其实各种函数都有
l 函数


包前主题 模块 的 各种
theme函数好像既可用于模块 也可用于tpl.php模板文件,应该也可以用于template.php文件吧
$result = db_query_range('SELECT n.title, n.body, n.created
    FROM {node} n WHERE n.uid = %d', $uid, 0, 10);

theme('item_list', $links);//体会一下

表示 输出一个 ul 其 class='item_list'
其中 li 里面的东西就是 $links

_函数 表示是私有的



http://api.drupal.org
普通分类: 
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文件中才会起作用


<?php if (isset($primary_links)) : ?>
          <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?>
        <?php endif; ?>
        <?php if (isset($secondary_links)) : ?>
普通分类: 
shiping1 的头像

模板里的变量覆写

在 template.php中如何覆写变量
1)page.tpl.php里的变量 用
主题名_变量名() (如function zen_breadcrumb($breadcrumb))
进行覆写
2)node.tpl.php里的变量 用
主题名_node_变量名() (如function myminnelli_node_submitted($node) )
进行覆写
普通分类: 
shiping1 的头像

与用户有关的模块 管理用户 用户登录 安全 模块 密码只能错几次等 限制 登录次数 有大用

1)Advanced User 模块 管理用户
迅速查找 设置访问权限等
2)login_security 模块 为了登录安全
安装后 进 admin/settings/login_security 设置
普通分类: 
shiping1 的头像

Answers 模块 问答模块 答案模块

Answers

普通分类: 
shiping1 的头像

Voting API 模块

Voting API
模块地址: http://drupal.org/project/votingapi
模块版本: Drupal 7.xDrupal 6.x
用户数: 54 359
依赖:无
模块类型: 评价/等级
该模块主要为Drupal的一些投票模块提供函数接口,比如Vote_up_down和Rate等投票模块。
普通分类: 
shiping1 的头像

overriding ubercart - add to cart button 超越增加到购物车按钮的方法

rupal Answers is a question and answer site for Drupal developers and administrators.
普通分类: 
shiping1 的头像

drupal ubercart 直接购买 不增加到购物车

这个模块 可以实现 应该有用
https://drupal.org/project/uc_paypal_buttons  //好像只是paypal这种付款方式的模块 对
其它的付款方式 如支付宝等不起作用
看下 http://www.ubercart.org/project/buy_now
uc_buy_now.tar.gz  应该有用 因为福建那个网友也推荐它


http://www.ubercart.org/forum/development/1800/buy_now_button_bypass_cart

普通分类: 
shiping1 的头像

drupal ubercart 自己学习4

1)支付方式  货到付款, 网上银行, 支付宝 ,google checkout ,peiqu等
2)支付宝对应的是支付宝网关
网关是一种格式化的设置,是一种接口
ubercart 一般用的是 google checkout(在模块里应该可以看到,现在已兴起) paypal(在模块里应该可以看到,早期用) Credit Card(在模块里应该可以看到)

Test Gateway (模块) 和 Credit Card 对应
我们开启 Credit Card和 Test Gateway这两个模块
进 admin/store/settings/payment
进 admin/store/settings/payment/edit
进 admin/store/settings/payment/edit/methods
出现错误 点the encryption instructions in order 看看
单独 放一个在drupal网站外的文件夹 为了安全

普通分类: 
shiping1 的头像

drupal 模板下载

shiping1 的头像

Drupal Zen 基模板菜鸟终结者 1 ---- 认识Zen Drupal Zen 基模板菜鸟终结者 2 ---- 增加对Nice Menus 的支持 Drupal Zen 基模板菜鸟终结者 3 ---- 一些基于Zen的子模板 Drupal Zen 基模板菜鸟终结者 4 ---- drupalla.com案例讲解

普通分类: 
shiping1 的头像

给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,会显示下面的结果:

普通分类: 

页面

Subscribe to RSS - drupal