简体   繁体   English

在Joomla文章中分配时,插件的“自定义字段”不会更新值

[英]Custom Field of plugin does not update the value when assigned in Joomla Article

Joomla 3.4 Stable Version, Content Plugin Joomla 3.4稳定版,内容插件

Simply explain the problem > click here 简单地解释问题> 单击此处

Picture of custom field which assigned '5555' : http://i.stack.imgur.com/5qlsS.png 分配了“ 5555”的自定义字段的图片: http : //i.stack.imgur.com/5qlsS.png

Expected Output: 5555 预期产量:5555

Real Output : defaultvalue 实际输出:默认值

Print Output Code 打印输出代码

$plugin = JPluginHelper::getPlugin('content', 'signal');

$params = new JRegistry($plugin->params);

echo $params->get('custom_1','default_value');

XML Code XML代码

<field name="custom_1"
       type="text"
       label="Custom Field 1"
       /> 

From the image it seems that the parameter you try to acess is not in the plugin ,but it is in the article (new field created by plugin) so try to use this code 从图片看来,您尝试访问的参数似乎不在插件中,而是在文章中(插件创建的新字段),因此请尝试使用此代码

$params= json_decode($this->item->attribs);
echo $params->custom_1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM