我可以在drupal节点的主体中添加一些变量吗? [英] could i add some variables into the drupal node body?

查看:138
本文介绍了我可以在drupal节点的主体中添加一些变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建一个使用故事类型的文章时,可以将一些变量添加到body的textare中。可以调用该变量并输出。谢谢。
drupal版本是6。

when i create an article useing the story type,could i add some variables into the body's textarea.then can invoke the variable and output it. thank you. the drupal version is 6.

推荐答案

插入文本占位符以便在渲染上被实际值替换为Drupal中的过滤器系统令牌过滤器提供了令牌替换,如果您需要替换标记值,则是一个方便的工具。但是有大量的过滤条件Drupal 6.x ,你甚至可以自定义模块中定义自己的。 自定义过滤器可以帮助您。您还可以使用令牌过滤器并在自定义模块中定义自己的令牌。

Inserting textual placeholders to be replaced by actual values on render is the purpose of the filters system in Drupal. Token filter provides, well, token replacement and is an handy tools if your need replacement for tokenized values. But there are plenty of filters for Drupal 6.x and you can even define your own in a custom module. The Custom filter can help for this. You can also use token filter and define your own token in your custom module.

一个简单的解决方案是使用PHP过滤器,但这是一种不安全的方法。此外,将PHP代码放在节点(或任何内容)中是一个维护噩梦和不良习惯。你最好从一开始就做得好。

A simple solution is to use the PHP filter but this is a insecure way of doing it. Also, putting PHP code in node (or any content) is a maintenance nightmare and a bad habits. You would be better doing it properly from the start.

这篇关于我可以在drupal节点的主体中添加一些变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆