• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Remove Signatures

Mian Shahid

Well-known member
#1
Hi, i am trying to re-create my template modification
Remove user signatures from selected forums. to XML version, because many peoples do not like to modify templates manually (including me :)).
2014-06-11_011101.gif
As described in mentioned thread, this add-on will edit template message and replace
Code:
<xen:if is="{$visitor.content_show_signature} && {$message.signature}">
with
Code:
<xen:if is="!in_array({$forum.node_id}, array(12, 22, 24)) && {$visitor.content_show_signature} && {$message.signature}">
where 12, 22, 24 are node IDs.
2014-06-11_011354.gif
For node IDs selection , i am trying to add "Option" where user can enter node IDs in which this replacement will apply.
2014-06-11_011722.gif
and this is the setting which is not correct as i don't know how to set "Options"
2014-06-11_011851.gif
I don't know the actual code to include Option with this replacement.

Need guidance from Experts?
 

Lawrence

Well-known member
#3
Hi, I haven't "played" with XF's option groups for a while, so I am only going by memory. You are getting that error because you are using a text box for the input and the data type is set to an array, so it is looking for more options (array key names to store other text box data), ie:

forumId
userId
groupId

To use the array data type, you would need to select Check Boxes, or create a Multi-Selection drop-down, both would need you to use a callback to generate the forum list.

If you leave it as a text-box, you will need to set the data-type as a string, and then on thread view (using a listener) convert the option from a string to an array.

Personally, I would just add an option to the Node (when creating/editing a node), then your add-on users won't need to worry about updating any Option group you made, :)