WPIntell

Source evidence

Custom list

Listo · support · 2022-09-18T11:08:00+00:00

mixedsentiment
mediumseverity
0.84relevance
16replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 30 rows with source links

3.3% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
mstudioIL resolved
Is there way to make my own list? Yes. You can add a list type using the listo_list_types filter 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_types filter 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? If you change the meta key within the $list_types , you’ll need to update your form setup too: <label> Select a product [select your-product data:products] </label>

Comments

16 shown
Takayuki Miyoshi 2022-09-19T03:41:00+00:00

Yes. You can add a list type using the listo_list_types filter hook.

mstudioIL 2022-09-19T06:01:00+00:00

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?

Yordan Soares 2022-09-19T16:39:00+00:00

@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

mstudioIL 2022-09-20T06:37:00+00:00

@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?

Yordan Soares 2022-09-20T14:27:00+00:00

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_types filter hook to do it, as explained above.

bitspecial22 2022-09-21T06:34:00+00:00

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.

mstudioIL 2022-09-21T06:38:00+00:00

@bitspecial22 please open you own topic

mstudioIL 2022-09-21T06:53:00+00:00

@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

Yordan Soares 2022-09-21T14:42:00+00:00

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 😉

mstudioIL 2022-09-21T14:45:00+00:00

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?

Yordan Soares 2022-09-21T14:55:00+00:00

Yes, that’s right: After activating the code, and updating your form setup, you should see your new list working in the front-end.

mstudioIL 2022-09-22T06:00:00+00:00

Thanks

mstudioIL 2022-09-22T09:48:00+00:00

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?

Yordan Soares 2022-09-22T15:08:00+00:00

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 .

mstudioIL 2022-09-28T05:26:00+00:00

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?

Yordan Soares 2022-09-28T07:54:00+00:00

If you change the meta key within the $list_types , you’ll need to update your form setup too: <label> Select a product [select your-product data:products] </label>