• Resolved jimcrist

    (@jimcrist)


    I’m using your dropdown in a widget, but I don’t want it to show up on every page. I’m using the plug-in Display Widgets which has check boxes to control which pages, which widgets show up on. There’s also a plug-in called Widget Logic which uses conditional tags to control which widgets show up on which pages.

    When I open the Dropdown widget it shows all the pages and check boxes, but it says “there are no options for this widget”. I can check the pages I want your widget to show up on, but there’s no Save button, just close. Bottom line, I can’t control which pages your widget shows up on.

    Is there a way I can control which pages your widget shows up on?
    Thanks,
    Jim
    +++++++++++++++++++++++
    Hey Jim,

    Just checked what is the issue. I’m a bit doing the thing not_the_correct_way with registering the widget and that’s way there is no option for “save” the changes.

    I have made the needed changes but this will be released some day later.

    There is a plug-in that might be a solution for you until the update:

    https://www.ads-software.com/plugins/dynamic-widgets/

    Al

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author alordiel

    (@alordiel)

    Thank you, Jim. I will try to finish the update ASAP.

    Regards,
    al

    Plugin Author alordiel

    (@alordiel)

    By the way may be replacing the widget code with this one will be a better solution till i release the next version.

    // Creating the widget
    class dms_widget extends WP_Widget {
    
    	function __construct() {
    		parent::__construct(
    		// Base ID
    		'dms_widget', 
    
    		// Widget name
    		__('Dropdown Multisite Selector', 'dropdown-multisite-selector'), 
    
    		// Widget description
    		array( 'description' => __( 'Shows a select options with site/multisites.', 'dropdown-multisite-selector' ), )
    		);
    	}
    
    	// This is where the action happens
    	public function widget( $args, $instance ) {
    		echo $args['before_widget'];
    		if ( ! empty( $instance['title'] ) ) {
    			echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];
    		}
    		echo do_shortcode('[dms]');
    		echo $args['after_widget'];
    
    	}
    
    	public function form( $instance ) {
    
    		if ( isset( $instance[ 'title' ] ) ) {
    			$title = $instance[ 'title' ];
    		}
    
    		else {
    			$title = __( 'New title', 'dropdown-multisite-selector' );}
    		?>
    			<p>
    			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
    			</p>
    		<?php
    	}
    
    	public function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
    		return $instance;
    	}
    
    } 
    
    // Register and load the widget
    function dms_load_widget() {
    	register_widget( 'dms_widget' );
    }
    add_action( 'widgets_init', 'dms_load_widget' );
    Thread Starter jimcrist

    (@jimcrist)

    Hi Al,
    I tried replacing that part of your code, but I still get the “418 Unused” Error.
    Thanks,
    Jim

    Plugin Author alordiel

    (@alordiel)

    Hi Jim,

    I read a bit more about this error. It seems that is not a php but server error due to same farewall or security settings set by the host. I’m not sure if my plugin can cause this as it has very little interaction with anything.
    When exactly the error appears?

    Thread Starter jimcrist

    (@jimcrist)

    Strangely, I didn’t see your last post, but I did answer your question in an earlier post in a different thread (see below). This “418 Unused” error appears to be a DreamHost security measure with mod_security. https://www.ads-software.com/support/topic/live-writer-418-unused-server-error

    Are you making any progress on an update for your plugin? Thanks!
    Jim
    +++++++++++++++++++
    Hi Al,
    I too need to be able to sort the items in the dropdown control. But even if I go into dropdown-multisite-selector.php and immediately hit Update File, I get an “unused” error: The server encountered an internal error or misconfiguration and was unable to complete your request.

    I can edit and save any other script I try, but not yours? What’s up with that? Thanks for your help!
    Jim

    Plugin Author alordiel

    (@alordiel)

    Hi, Jim,

    Sorry for the late answer. I’m currently struggling with the WordPress SVN repository to push my next version. I’m curious if you will still get the same error after this.
    But as I’m not sure how long it will take till someone from the support guide me with my issue I’m providing with a link to my github where you can download the latest version.

    Thread Starter jimcrist

    (@jimcrist)

    Hi Al,
    I installed it, but couldn’t get it to work. It’s the first time I’ve used FTP to install a plugin, so possibly I did something wrong. I downloaded from github, unzipped it on my computer, and used FTP to upload it to the plugin directory. At that point I had two directories, dropdown-multisite-selector (the old directory) and dropdown-multi-site-selector-master (the new directory). I went into WordPress and there is now a 4.1 and a 5.0 version, so I activated the 5.0 one. I think the 4.1 one was already deactivated.

    The problem is there’s no option showing up under Settings, so I can’t set it up, so it doesn’t work. The dropdown doesn’t show up on the website. The 4.1 version still works, when I activate that. I have them both activated at the moment. I tried renaming the directories, so the the 5.0 version is dropdown-multisite-selector, but it didn’t help. Please get back to me on this…thanks!

    Plugin Author alordiel

    (@alordiel)

    Hi Jim,
    Thanks for the notice. I have check the problem an unfortunatelly there was a big bug in my code. There are few files I am not loading properly. Unfortunatelly after the fix something else turned out that is not working and i can localize the problem.
    Hope tomorrow to have more free time to spent on this issue. Sorry for delaying you.

    Thread Starter jimcrist

    (@jimcrist)

    Hi Al,
    It’s been another five weeks. I hope you’re making progress?
    Thanks,
    Jim

    Thread Starter jimcrist

    (@jimcrist)

    Hello? Al? Is there another plugin that does this? I can’t wait much longer…

    Plugin Author alordiel

    (@alordiel)

    Hello Jim,

    I don’t have much time to finish the plugin, but I can spend some time on investigating the problem with your installation. can you send me a ftp credentials and an admin account for your site. Send them to [al]at[shtrak.eu]

    Really sorry that I have delayed you so much.

    Regards,
    Alex

    Thread Starter jimcrist

    (@jimcrist)

    Thank you for helping me today! I was trying to sort my list alphabetically. It’s just a list where users can select one and get redirected to a page on the same site. Al told me to put the line ksort($options); as the first line after the IF statement if ( $options ) { in the noneOptions function.

    He also helped me modify his plugin, so that it would be compatible with the Display Widgets plugin. Excellent Service!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Compatibility with plugin Display Widgets’ is closed to new replies.