Custom list
-
Yes. You can add a list type using the
listo_list_typesfilter hook.Thanks, I will look at it, I need to use all the code in the link on the child theme functions.php file?
Do you know about some example I can look at?@mstudioil no, what the plugin’s author meant is that you have to pass your own code through that filter hook.
See this example for reference: New dataset: Nationality
@yordansoares
Thanks, I think this what I need to understand how to use this
for'en' => _x( 'English', 'language', 'listo' ),I will see “English” in the list and the value will be “en”?
I will try it, there is no way the user can create list of is own on the Admin area?for ‘en’ => _x( ‘English’, ‘language’, ‘listo’ ), I will see “English” in the list and the value will be “en”?
That’s right.
…there is no way the user can create list of is own on the Admin area?
The plugin doesn’t have an admin interface to do that yet: You need to set your custom lists using the
listo_list_typesfilter hook to do it, as explained above.Hi there!
Am I doing somehting wrong, I just installed this and tried to use a form field
[select* currencies includeblank data:currencies]This does not appear to work as advertised because I am seeing e.g. for currencies
<option value=”United Arab Emirates dirham”>United Arab Emirates dirham</option>When, according to what you wrote 16 hours ago, I should be seeing
<option value=”aed”>United Arab Emirates dirham</option>Please advise.
@bitspecial22 please open you own topic
@yordansoares thanks for the help, I will check with the site owner if the want to use this way since they will not be able the update the list this way with new values like they can using the regular method
Hi @mstudioil,
A way to update the list from the Dashboard may be adding the code using the Code Snippets plugin, then the admins would be able to update the code without the need of editing PHP files. Hope it helps 😉
Thanks, I usually using the functions.php on the child theme to add code, I will look for you sent, I just enter the code you gave with the change I need to the plugin?
Yes, that’s right: After activating the code, and updating your form setup, you should see your new list working in the front-end.
Thanks
I just test the site and country list I used with listo is not working,
if I add the code you gave it disable the country?If you’re referring to the code you find here, it’s an example about how to add your own lists. Please note that you’ll need to use a custom combination of
'key' => 'value'withing$list_types.I used this code
/** * Add a list of products to Listo */ // Filter to enqueu the language list /* if ( interface_exists( 'Listo' ) ) { add_filter( 'listo_list_types', function( $list_types ) { $list_types = array( 'products' => 'Listo_products', ); return $list_types; }, 10, 1 ); // Class to handle the language list class Listo_products implements Listo { private function __construct() {} public static function items() { return array( 'en' => _x( 'English', 'products', 'listo' ), 'es' => _x( 'Spanish', 'products', 'listo' ), 'it' => _x( 'Italian', 'products', 'listo' ), 'fr' => _x( 'French', 'products', 'listo' ), 'nl' => _x( 'Dutch', 'products', 'listo' ), 'de' => _x( 'German', 'products', 'listo' ), ); } public static function groups() { return array(); } } }Why it cause problems with the list for countries?
The topic ‘Custom list’ is closed to new replies.