What are possible fields' filters in Joomla module parameters?
Asked Answered
H

3

6

I am looking for possible filters' list when adding parameters' field for a module settings.

I know that filter="raw" and filter="integer" exists from examples at Text form field type.

But what are other possible filters for these fields?

Heraclitus answered 15/8, 2013 at 19:43 Comment(0)
D
15

I am not totally sure if this is it, but may want to see this list directly from the code, with the method clean().

So the list would be:

  • INT / INTEGER
  • UINT
  • FLOAT / DOUBLE
  • BOOL / BOOLEAN
  • WORD
  • ALNUM
  • CMD
  • BASE64
  • STRING
  • HTML
  • ARRAY
  • PATH
  • USERNAME
  • RAW

Let me know if this helps.

Destruction answered 16/8, 2013 at 17:27 Comment(3)
EMAIL doesn't do anything in this case. Thank you for your answer :)Heraclitus
There should also be media for images... at least I'm using it. Personally I'm looking for something like URL...Colwell
"safehtml" was added I thinkAdjutant
F
2

Posting as a guest so I couldn't comment ;) You might also find the list of available field types useful for capturing data like URLs and emails. You can find the full list here. Also available in the folder structure at libraries/cms/form/field and libraries/joomla/form/fields. There are URL and email fields which, I believe, include the relevant filtering. Usage would be as follows in the .xml:

<field name="myAwesomeURL" type="url" class="awesome"></field>

This renders as a text input box.

Fillet answered 12/12, 2013 at 16:12 Comment(2)
I think he was asking about filter, not field.Gandhiism
Yeah, but it's worthwhile to know URL and EMAIL field types already exist.Torque
G
2

To be precise, Joomla starts applying the filter with this filterField function. In this code, you can see some more filter types like TEL, SAFEHTML or so. From this function, if there's no match, it will go further to the one mentioned by @ValentinDespa. It also enables you to call your own function, as long as it's "callable". I found out this scattering after I looked into code by another dev having filter="intval".

Hope that helps!

Gandhiism answered 12/2, 2014 at 16:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.