首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >主题中的filtered_html -setings.php

主题中的filtered_html -setings.php
EN

Drupal用户
提问于 2016-09-29 19:42:46
回答 1查看 126关注 0票数 0

在我的主题-setings.php中,我希望将文本格式设置为'filtered_html'并在page.tpl.php中显示。

我使用此代码显示文本区域:

代码语言:javascript
复制
$form['options']['description'] = array(
'#type'          => 'textarea',
'#title'         => t('Description'),
'#default_value' => theme_get_setting('description'),
);

并使用<?php print strip_tags(theme_get_setting('description')); ?>在page.tpl.php中显示

如何将文本区域设置为使用'filtered_html'格式

EN

回答 1

Drupal用户

发布于 2016-09-29 21:23:16

试试这个:

代码语言:javascript
复制
$form['options']['description'] = array(
'#type'          => 'text_format',
'#title'         => t('Description'),
'#default_value' => theme_get_setting('description'),
'#format'        => 'filtered_html',
);

https://api.drupal.org/api/drupal/developer!topics!forms_api接口_参考资料.text/7.x/#文本_格式化

票数 0
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/216392

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档