Build with IDX Broker Forums IDX Broker Control Panel Javascript in Control Panel Re-Ordering Residential Property Sub Types

Viewing 4 reply threads
  • Author
    Posts
    • Bill Macchio
      Participant
      Post count: 27

      For our search pages like http://listings.pastermackrealestate.com/idx/search/advanced our client would like to put the Residential Property Sub Types in a specific order. The current list of checkboxes is alphabetized from Condos to Single Family Detached. The client wants them ordered
      Single Family Detached, Condo, Condo-Tel, Coop, Half Duplex, Mobile/Manufactured, Time Share, Townhouse.

      I found out how to change the order of the Property Types (That was great!) and I checked Designs > Pages > My Search Page Name > Edit Preferences > Search Setup and I can hide all of these Sub Property Types, but I cannot see a way re-order them. I also looked at http://support.idxbroker.com/customer/portal/articles/1913052-customize-basic-search-fields and these are Basic/Core Fields I don’t seem to be able to edit/replace directly. Would I use Javascript to change the innerHTML for #IDX-propSubType to re-order the list the way I want?

      0 ratings, 0 votes0 ratings, 0 votes (0 rating, 0 votes, rated)
      You need to be a registered member to rate this post.
      Loading...
    • Nick Leech
      Keymaster
      Post count: 183

      Yes, you could use JS to change the inner HTML.

      I would honestly just build a custom search form so you can arrange the HTML however you would like and you would have total control over how it displays: https://developers.idxbroker.com/lesson/create-custom-advanced-search-page/

      0 ratings, 0 votes0 ratings, 0 votes (0 rating, 0 votes, rated)
      You need to be a registered member to rate this post.
      Loading...
    • Bill Macchio
      Participant
      Post count: 27

      I’d love to do that, but it won’t give me a fully functional Advanced Search for Residential, Vacant Land and all other property types. I have no idea how to make it work so that changing the property type in the dropdown also changes the form to match.

      I have put this into the Global sub header and its not working. I’ve turned off the WYSIWYG editor so I can add HTML. Essentially I’m just moving Single Family Detached to the beginning of the list:

      <script>
      idx(document).ready(function(){
      document.getElementById(‘IDX-propSubType’).innerHTML = ‘<label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Single Family Detached” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Single Family Detached</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Condo” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Condo</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Condo-Tel” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Condo-Tel</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Coop” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Coop</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Half Duplex” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Half Duplex</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Mobile/Manufactured” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Mobile/Manufactured</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Time Share” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Time Share</label><label class=”IDX-selectableListLabel”><input type=”checkbox” value=”Townhouse” name=”a_propSubType[]” class=”IDX-selectableListCheckbox “>Townhouse</label>’});
      </script>

      I also tried the above code without the “.ready” statement.

      0 ratings, 0 votes0 ratings, 0 votes (0 rating, 0 votes, rated)
      You need to be a registered member to rate this post.
      Loading...
    • Bill Macchio
      Participant
      Post count: 27

      I’ve modified my Javascript to this and even tried variations of it in my PHP wrapper:

      <script>
      idx(document).ready(function(){
      document.getElementById(“IDX-propSubType”).innerHTML = “<label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Single Family Detached\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Single Family Detached</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Condo\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Condo</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Condo-Tel\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Condo-Tel</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Coop\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Coop</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Half Duplex\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Half Duplex</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Mobile/Manufactured\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Mobile/Manufactured</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Time Share\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Time Share</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Townhouse\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Townhouse</label>”;});
      </script>

      0 ratings, 0 votes0 ratings, 0 votes (0 rating, 0 votes, rated)
      You need to be a registered member to rate this post.
      Loading...
    • Bill Macchio
      Participant
      Post count: 27

      Okay I got this to work …. instead of adding the code to my Global sub-header I’ve added it in my PHP Global Wrapper Include file. Since it was firing before page loaded the data into this element I had to find the Javascript to make it wait until after the page is loaded. This works on my Advanced Search and now I just need to edit for the other 2 Search pages (EDIT: Yes, this works for all of the Search pages I have created):

      <script>
      $(window).bind(“load”, function() {
      document.getElementById(“IDX-propSubType”).innerHTML = “<label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Single Family Detached\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Single Family Detached</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Condo\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Condo</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Condo-Tel\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Condo-Tel</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Coop\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Coop</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Half Duplex\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Half Duplex</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Mobile/Manufactured\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Mobile/Manufactured</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Time Share\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Time Share</label><label class=\”IDX-selectableListLabel\”><input type=\”checkbox\” value=\”Townhouse\” name=\”a_propSubType[]\” class=\”IDX-selectableListCheckbox \”>Townhouse</label>”;
      });
      </script>

      0 ratings, 0 votes0 ratings, 0 votes (0 rating, 0 votes, rated)
      You need to be a registered member to rate this post.
      Loading...
Viewing 4 reply threads
  • You must be logged in to reply to this topic.