Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

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

    Thread Starter mstudioIL

    (@mstudioil)

    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?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    @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

    Thread Starter mstudioIL

    (@mstudioil)

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

    Plugin Contributor Yordan Soares

    (@yordansoares)

    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.

    Thread Starter mstudioIL

    (@mstudioil)

    @bitspecial22 please open you own topic

    Thread Starter mstudioIL

    (@mstudioil)

    @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

    Plugin Contributor Yordan Soares

    (@yordansoares)

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

    Thread Starter mstudioIL

    (@mstudioil)

    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?

    Plugin Contributor Yordan Soares

    (@yordansoares)

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

    Thread Starter mstudioIL

    (@mstudioil)

    Thanks

    Thread Starter mstudioIL

    (@mstudioil)

    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?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    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.

    Thread Starter mstudioIL

    (@mstudioil)

    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?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Custom list’ is closed to new replies.