zoukankan      html  css  js  c++  java
  • [Drupal] About the theme

    The order of loading preprocessors 

    template_preprocess

    - This is supplied by core and always added. The variables generated here are used for every templated hook.
    template_preprocess_hook
    - The module or core file that implements the theming hook supplies this. The initial generation of all the variables specific to the hook is usually done here.
    moduleName_preprocess
    - Do not confuse this with the preprocessor before it. This allows modules that did not originally implement the hook to influence the variables. Applies to all hooks.
    moduleName_preprocess_hook
    - Same idea as the previous preprocessor but for specific hooks.
    engineName_engine_preprocess
    - The preprocessor for theming engines. Applies to all hooks.
    engineName_engine_preprocess_hook
    - Another preprocessor for theming engines but specific to a single hook.
    engineName_preprocess
    - NOT RECOMMENDED. This is the first preprocessor that can be used inside the theme. It can be named after the theme engine the theme is running under. Applies to all hooks.
    engineName_preprocess_hook
    - NOT RECOMMENDED. Another preprocessor named after the engine but specific to a single hook.
    themeName_preprocess
    - This one is named after the theme itself. Applies to all hooks.
    themeName_preprocess_hook
    - Same as the previous preprocessor but for a specific hook.

    Default baseline variables to all template files

    $id
    The placement of the template. Each time the template is used, it is incremented by one.
    $zebra
    Either "odd" or "even". Alternate each time the template is used.
    $directory
    The theme path relative to the base install. example: "sites/all/themes/myTheme"
    $is_admin
    Boolean returns TRUE when the visitor is a site administrator.
    $is_front
    Boolean returns TRUE when viewing the front page of the site.
    $logged_in
    Boolean returns TRUE when the visitor is a member of the site, logged in and authenticated.
    $db_is_active
    Boolean returns TRUE when the database is active and running. This is only useful for theming in maintenance mode where the site may run into database problems.
    $user

    The user object containing data for the current visitor. Some of the data contained here may not be safe. Be sure to pass potentially dangerous strings through check_plain. 

  • 相关阅读:
    MySQL视图——学习笔记及实验
    小学生四则运算自动刷题库优化升级
    软件工程小项目——小学生四则运算自动刷题库
    笔记--运算符、表达式和语句
    笔记--基本数据类型与数组
    笔记--java入门
    原因: java.lang.ClassNotFoundException: Hello
    使用gopm代替go get 解决go包卡慢的问题
    调用微信截图功能c# 截图带扩展名
    如何用golang搜索抓取淘宝商品
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1931785.html
Copyright © 2011-2022 走看看