Dsidxpress Shortcodes

Below, you’ll find a detailed guide on how to add the Dsidxpress Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Dsidxpress Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Dsidxpress Plugin and the shortcodes it provides:

Plugin Icon
WordPress IDX Real Estate Listings & MLS Search

"WordPress IDX Real Estate Listings & MLS Search is a robust plugin that enables realtors to seamlessly integrate MLS listings and IDX search on their WordPress site. It's your ultimate real estate solution."

★★★✩✩ (66) Active Installs: 2000+ Tested with: 6.2.3 PHP Version: 5.4.0
Included Shortcodes:
  • [idx-quick-search]
  • [idx-registration-form]

Dsidxpress [idx-quick-search] Shortcode

The dsIDXpress plugin’s “idx-quick-search” shortcode enables a quick property search feature on your WordPress site. It uses the IdxQuickSearch function to customize the search format and view.

Shortcode: [idx-quick-search]

Parameters

Here is a list of all possible idx-quick-search shortcode parameters and attributes:

  • format – Defines the layout style of the search form, either “horizontal” or “vertical”
  • modernview – If set to “yes”, it loads a modern style for the search form, otherwise the classic view
  • viewtype – Allows to specify a custom view type for the search form, if left empty, defaults to standard

Examples and Usage

Basic example – A simple usage of the dsidxpress plugin shortcode to display a quick search form in a horizontal format.

[idx-quick-search format="horizontal"]

Advanced examples

Using the shortcode to display a quick search form in a vertical format, with the modern view enabled.

[idx-quick-search format="vertical" modernview="yes"]

Using the shortcode to display a quick search form in a horizontal format, with the modern view disabled, and specifying a custom view type.

[idx-quick-search format="horizontal" modernview="no" viewtype="custom"]

Using the shortcode to display a quick search form without specifying any parameters. The default values will be used in this case.

[idx-quick-search]

PHP Function Code

In case you have difficulties debugging what causing issues with [idx-quick-search] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode("idx-quick-search", array("dsSearchAgent_ShortCodes", "IdxQuickSearch"));

Shortcode PHP function:

function IdxQuickSearch($atts, $content = null, $code = ""){
		$atts = shortcode_atts(array(
			"format"		=> "horizontal",
			"modernview" => "no",
			"viewtype" => "",
		), $atts);
		ob_start();
		dsSearchAgent_IdxQuickSearchWidget::shortcodeWidget(array('widgetType'=>$atts['format'], 'modernView'=>$atts['modernview'], 'viewType'=>$atts['viewtype'], 'class'=>'dsidx-inline-form'));
		$markup = ob_get_clean();
		return '<p>'.$markup.'</p>';
	}

Code file location:

dsidxpress/dsidxpress/shortcodes.php

Dsidxpress [idx-registration-form] Shortcode

The dsidxpress plugin shortcode “idx-registration-form” is used to generate a registration form on your website. It allows users to register to save their favorite listings, searches, and receive the latest listing alerts. If the user is not a pro or is already logged in, the shortcode will display a quick search form. If not, it will display the registration form, which includes fields for the user’s first name, last name, email, phone number, and password. The shortcode also includes options for social login and a consent checkbox for data privacy policy.

Shortcode: [idx-registration-form]

Parameters

Here is a list of all possible idx-registration-form shortcode parameters and attributes:

  • format – Determines the orientation of the form, either horizontal or vertical.
  • modernview – If set to “yes”, the form will display in a modern style.
  • AccountID – The account ID related to the dsIDXPress plugin.
  • SearchSetupID – The ID that corresponds to the search setup in the dsIDXPress plugin.
  • redirecttourl – The URL where users will be redirected after registration.
  • includesociallogin – If set to “yes”, social login options will be included in the form.
  • RegistrationShowConsent – If set to “true”, a consent checkbox will be included in the form.

Examples and Usage

Basic example – Display the IDX Registration form using the shortcode.

[idx-registration-form /]

Advanced examples

Display the IDX Registration form with a custom redirection URL after successful registration.

[idx-registration-form redirecttourl="https://www.yourwebsite.com/welcome" /]

Display the IDX Registration form with social login buttons included.

[idx-registration-form includesociallogin="yes" /]

Display the IDX Registration form with a custom redirection URL after successful registration and social login buttons included.

[idx-registration-form redirecttourl="https://www.yourwebsite.com/welcome" includesociallogin="yes" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [idx-registration-form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode("idx-registration-form", array("dsSearchAgent_ShortCodes", "IdxRegistrationForm"));

Shortcode PHP function:

function IdxRegistrationForm($atts, $content = null, $code = ""){
		$options = get_option(DSIDXPRESS_OPTION_NAME);
		$quickSearchAtts = shortcode_atts(array(
			"format"		=> "horizontal",
			"modernview" => "yes",
		), null);
		if(!isset($options["dsIDXPressPackage"]) || $options["dsIDXPressPackage"] != "pro"){ /* if not pro show quick search */
			return self::IdxQuickSearch($quickSearchAtts);
		}
		else if (isset($_COOKIE['dsidx-visitor-auth']) && sanitize_text_field($_COOKIE['dsidx-visitor-auth']) != '') { /* if logged in show quick search */
			return self::IdxQuickSearch($quickSearchAtts);
		}	
		else {	/* show registration form */
				$accountID = isset($options["AccountID"])?esc_html($options["AccountID"]):false;
				$searchSetupID = isset($options["SearchSetupID"])?esc_html($options["SearchSetupID"]):false;
				$redirectURL = isset($atts["redirecttourl"]) ? esc_url($atts["redirecttourl"]) : '';
				$socialLogin=false;
				$contentForm="col-12";
				$contentFormField="col-12 form-group";
				$contentSocial="d-none";
				$uniqueFormID = esc_html(sha1('dsidx-shortcode-registration-form'.$accountID.$searchSetupID.$redirectURL.$socialLogin));
				$currentURL = site_url();
				$regLinkDiv="col-12 col-md-8 text-md-right";	
				$socialDisplay="none";
				if(isset($atts['includesociallogin']) && strtolower($atts['includesociallogin'])=='yes') {
					$socialLogin = true;
					$socialDisplay="inline";
					$contentForm = "col-12 col-md";
					$contentSocial="col-12 col-md text-center pt-md-5";					
					$regButtonStyle = "dsidx-shortcode-registration-submit";	
					$regButtonDiv="col-8";
					$regLinkDiv="col-12 text-left";	
					
				}
				else {
					$regButtonDiv="col-8 col-md-4";
					$contentFormField="col-12 col-md-6 form-group";
					$regButtonStyle = "dsidx-shortcode-registration-submit-no-sso";
				}

				$account_options = dsSearchAgent_GlobalData::GetAccountOptions(false);
				$regConsentHTML="";
				$isConsent = "false";				
				if(isset($account_options->{'RegistrationShowConsent'}) && strtolower($account_options->{'RegistrationShowConsent'})=='true') {
					$isConsent = "true";	
					$regConsentHTML = <<<HTML
					<div class="row">
						<div class="col-12 mb-3">
							<label class="checkbox" for="dsidx-shortcode-register-consent" style="text-align:left;">
								<input type="checkbox" id="dsidx-shortcode-register-consent" name="newVisitor.Consent" class="checkbox" checked="checked">
								By submitting this form, you confirm that you have read and accept the <a href="https://www.diversesolutions.com/privacy-policy/" target="_blank">Data Privacy Policy</a>
							</label>						
						</div>
					</div>
HTML;
				}

    return <<<HTML
 <div id="dsidx-shortcode-registration" class="ds-bs dsidx-shortcode-registration-main">
		<p class="dsidx-shortcode-registration-header ml-1 mr-1 text-center font-italic">
			<em>Save your favorite listings, searches, and receive the latest listing alerts.</em>
    	</p>
        <div class="row">
            <div class="{$contentForm} registrationform">
                <form id={$uniqueFormID} action="" method="post">
                    <input type="hidden" id="dsidx-shortcode-registration-referral" name="newVisitor.Referral" value="{$currentURL}" />
                    <input type="hidden" id="dsidx-shortcode-registration-packagetypeid" name="newVisitor.PackageTypeID" value="2" />
                    <input type="hidden" id="dsidx-isoptin" name="newVisitor.isOptIn" value="false" />
					<input type="hidden" id="dsidx-shortcode-registration-redirectURL" name="dsidx-shortcode-registration-redirectURL" value="{$redirectURL}" />
					<div class="row">
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-login-first-name">First Name:</label>
							</div>
							<div>
								<input type="text" id="dsidx-shortcode-registration-first-name" class="text dsidx-shortcode-registration-field"  name="newVisitor.FirstName" />
							</div>
						</div>
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-login-last-name">Last Name:</label>
							</div>
							<div>
								<input type="text" id="dsidx-shortcode-registration-last-name" class="text dsidx-shortcode-registration-field" name="newVisitor.LastName" />
							</div>
						</div>
					</div>
					<div class="row">
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-login-last-name">Email:</label>
							</div>
							<div>
								<input type="text" id="dsidx-shortcode-registration-email" class="text dsidx-shortcode-registration-field" name="newVisitor.Email" />
							</div>
						</div>
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-shortcode-registration-phone-number">Phone Number:</label>
							</div>
							<div>
								<input type="text" id="dsidx-shortcode-registration-phone-number" class="text dsidx-shortcode-registration-field" name="newVisitor.PhoneNumber" />
							</div>
						</div>
					</div>
					<div class="row">
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-shortcode-registration-password">Password:</label>
							</div>
							<div>
								<input type="password" id="dsidx-shortcode-registration-password" class="text dsidx-shortcode-registration-field" name="newVisitor.Password" />
							</div>
						</div>
						<div class="{$contentFormField}">
							<div>
								<label for="dsidx-shortcode-registration-confirm-password">Confirm Password:</label>
							</div>
							<div>
								<input type="password" id="dsidx-shortcode-registration-confirm-password" class="text dsidx-shortcode-registration-field" name="newVisitor.Password_Confirm" />
							</div>
						</div>
					</div>

					{$regConsentHTML}

                    <div class="row mb-4">
                        <div class = "{$regButtonDiv}">
							<input type="submit" id="dsidx-shortcode-registration-submit" value="Register" 
							class="dsidx-auth-large-button {$regButtonStyle}" />
						</div>
						<div class = "{$regLinkDiv}"> 
							Already have an account? <a href="{$currentURL}/idx?promptLogin=1">Login</a>
						</div>
						<div class="col-12" >
                            <div class="dsidx-shortcode-registration-dialog-message" style="display:none"></div>
                        </div>
                    </div>
                </form>
			</div>
            <div class="col-12 col-md-1 mt-4 mb-4 mt-md-5 mb-md-5 ml-md-3 mr-md-3" style="display:{$socialDisplay}">
				<div class="dsidx-sso-separator-bar">&nbsp;</div>
            </div>
			<div class="{$contentSocial}" style="display:{$socialDisplay}">
				<div class="col-12">
					<div class="dsidx-shortcode-registration-sso-message mb-3">
						<em>Sign in to, or create an account using your existing social account</em>
					</div>
				</div>
				<div class="col-12">
					<button class="dsidx-loginBtn dsidx-loginBtn--facebook" onclick="javascript:  dsidx.auth.LaunchSocialLogin('facebook','{$accountID}','{$searchSetupID}','{$redirectURL}',{$isConsent});" formnovalidate="">
						Facebook
					</button>
				</div>
				<div style="clear:both;padding: 1% 0;"></div>
				<div class="col-12">
					<button class="dsidx-loginBtn dsidx-loginBtn--google" onclick="javascript: return dsidx.auth.LaunchSocialLogin('google','{$accountID}','{$searchSetupID}','{$redirectURL}',{$isConsent});" formnovalidate="">
						Google&nbsp;&nbsp;&nbsp;
					</button>
				</div>					
			</div>
        </div>
    </div>
HTML;
    }
	}

Code file location:

dsidxpress/dsidxpress/shortcodes.php

Conclusion

Now that you’ve learned how to embed the Dsidxpress Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *