+ Reply to Thread
Results 1 to 10 of 10

Thread: Adding Snippets

  1. #1
    Join Date
    Feb 2008
    Location
    Lexington, KY
    Posts
    157

    Default Adding Snippets

    Sorry if this is an elementary question, but I need some instruction on adding snippets. I want to add snippets on my city pages that create a price table in the navigation menu.

    I know I saw one posted on here somewhere but can't find it. Then, after I get the snippet code, do I just paste it into the html code?

    If there's some tutorial on adding snippets, that would be great. Or if there's someone I can call to guide me through getting started, that would be fantastic.

    Thanks!
    Sharon Roark
    Keller Williams Bluegrass
    Lexington, KY
    859-433-3676
    www.LexingtonRealEstateSource.com

    As a life-long resident of Central Kentucky, I have extensive knowledge of real estate in Lexington, KY and of the surrounding areas. Let me put this market knowledge to work for you when buying or selling a home in Lexington, KY.

    Lexington Ky Real Estate Blog

    Home Staging in Lexington, KY

  2. #2
    Join Date
    May 2007
    Location
    Davis, CA
    Posts
    1,469

    Default Re: Adding Snippets

    Hi Sharon, you need REW to create you a sample snippet and from there you can learn to modify them to get the results you want. To check and see if they have already created any sample snippets, go into your CMS, click manage snippet and the list of available snippets comes up.

    Edited to add: I just took a look at your site. Not sure you have a REW IDX installed. The property snippets work only along with their custom IDXs.
    Last edited by Discover Davis Homes; 09-20-2008 at 02:23 PM.

  3. #3
    Join Date
    May 2008
    Posts
    1,170

    Default Re: Adding Snippets

    There's not really a tutorial, but here's what Mike, one of our fine programmers, sends out to his clients:

    Here is a quick over view of snippets and how you can use them to dynamically pull in the latest listings into your content pages using various search criteria.
    Snippets are blocks of code that can be placed into any page by inserting the snippet's name between number symbols. (ie: #snippet#, #other-snippet#, etc.)

    For example, I've created the snippet #sample-idx-snippet# which can be seen on this page, http://dev29.rewtemplates.com/idx-snippet.php.

    You can create and manage IDX Snippets from the CMS Backend. http://dev29.rewtemplates.com/backend/

    Creating IDX Snippets

    Once logged in, click on "Manage Snippets" from the secondary menu. This brings you to the Snippet Manager.

    Look for the snippet labeled #sample-idx-snippet# and select "EDIT". You should now be seeing the form containing the snippet code. I'll go through it line-by-line and explain what it does. Take note that anything following double slashes is commented out.

    /* Snippet Settings */
    $_REQUEST['snippet_title'] = 'Calgary - Arbour Lake';
    $_REQUEST['snippet_price_table'] = true;

    The code above alters the display of the snippet. You can leave these fields empty or comment them out if you'd like. They control the snippet's h1, and price range links. Change these or comment them out to see the effect.


    /* Search City */
    $_REQUEST['search_city'][] = 'Arbour Lake';

    You can define one or more area to search using the code above. I've attached a list Notice how every line ends with a semi-colon and values are between single quotes.
    All available search values are listed on the IDX search form, http://dev29.rewtemplates.com/idx/.

    /* Search Postal Code */
    //$_REQUEST['search_zip'][] = '';

    Instead searching by area, you may want to search by postalcode(s). This you can do using the line above.

    /* Search by MLS Number */
    //$_REQUEST['search_mls'][] = '';

    The same applies for MLS Numbers. Use the code above to select results by MLS Number instead of using cities or zip codes.

    /* Property Type */
    //$_REQUEST['search_type'][] = 'SF'; // Single Family
    //$_REQUEST['search_type'][] = 'COND'; // Condominiums

    The above code selects the property type you would like to search. This example searches all Residential Listings. You can un-comment these lines to search by just a single properly class. Note that these values are shortened codes.

    /* Price Range */
    //$_REQUEST['minimum_price'] = 300000;
    //$_REQUEST['maximum_price'] = 0;

    /* Bedrooms */
    //$_REQUEST['minimum_bedrooms'] = 0;
    //$_REQUEST['maximum_bedrooms'] = 0;

    /* Bathrooms */
    //$_REQUEST['minimum_bathrooms'] = 0;
    //$_REQUEST['maximum_bathrooms'] = 0;

    /* Square Feet */
    //$_REQUEST['minimum_sqft'] = 0;
    //$_REQUEST['maximum_sqft'] = 0;

    /* Year Built */
    //$_REQUEST['minimum_year'] = 0;
    //$_REQUEST['maximum_year'] = 0;

    /* Acres */
    //$_REQUEST['minimum_acres'] = 0;
    //$_REQUEST['maximum_acres'] = 0;

    The block of code above is used to search fields that contain integer values. Minimum Price, Maximum Price, Minimum Bedrooms, Maximum Bedrooms, Minimum Bathrooms, Maximum Bathrooms, Min / Max.Year Built, and Min. / Max. Acres. Simply fill in the number you'd like to search and uncomment the line (remove the "//").

    $_REQUEST['page_limit'] = 5;

    The last editable line of code is above. This code determines the number of listings to display per page. Enter any number greater than 0.

    /** DO NOT EDIT BELOW THIS LINE **/
    $_REQUEST['snippet'] = true;
    include $_SERVER['DOCUMENT_ROOT'] . '/idx/common.inc.php';
    include_once $_SERVER['DOCUMENT_ROOT'] . '/idx/inc/php/pages/search.php';

    The above lines must not be changed as they include and set the files that are used to pull in the IDX listings.

    When you want to create a snippet, simply copy this code and create a new snippet, editing the code as desired.

    Using IDX Snippets

    Another important note for when using IDX snippets, be sure to use the #snippet-top# and #snippet-bottom#. These snippets are used to wrap content in so it will only display on the main area page.
    This gets rid of duplicate content on the price range pages or the rest of the listing result pages. Check out the "IDX Snippet" page in the CMS and you'll see how these snippets are used.

    http://dev29.rewtemplates.com/idx-snippet.php
    http://dev29.rewtemplates.com/idx-snippet.php?page=2
    http://dev29.rewtemplates.com/idx-sn...200000-300000/

    Example Usage:

    #snippet-top#
    <h1>Area Heading</h1>
    <p>We are the top choice Area Realtor.</p>
    #snippet-bottom#

    Area Listings updated Daily.
    #mls-area-snippet#
    The content between the #snippet-top# and #snippet-bottom# snippets will not be displayed on the rest of listing result pages.
    When using these snippets, you must include both snippets on the page. The top snippet must be before the bottom snippet, or an error will occur.

    Hope it helps,
    Vera

  4. #4
    Join Date
    Feb 2008
    Location
    Lexington, KY
    Posts
    157

    Default Re: Adding Snippets

    I really appreciate your help, but I'm afraid I'm still a little lost.

    I created the below code based on the sample idx snippet that was in my cms, but all the page displays is a "no results were found" message.

    Here's the snippet code I created (all I changed was entering a city name and snippet name):
    <?php

    $_REQUEST['idx'] = 'residential';

    $_REQUEST['search_city'][] = 'Lexington';

    $_REQUEST['search_subdivision'][] = 'subdivision name';

    $_REQUEST['snippet_price_table'] = true;

    $_REQUEST['snippet_title'] = 'LexingtonSearch';

    $_REQUEST['minimum_bedrooms'] = '0';

    $_REQUEST['maximum_bedrooms'] = '100';

    $_REQUEST['minimum_bathrooms'] = '0';

    $_REQUEST['maximum_bathrooms'] = '100';

    $_REQUEST['minimum_price'] = '0';

    $_REQUEST['maximum_price'] = '1000000';

    $_REQUEST['minimum_sqft'] = '0';

    $_REQUEST['minimum_acres'] = '0';

    $_REQUEST['minimum_year'] = '1900';

    /** DO NOT EDIT BELOW THIS LINE **/
    $_REQUEST['snippet'] = true;
    include_once $_SERVER['DOCUMENT_ROOT'] . '/idx/common.inc.php';
    include_once $_SERVER['DOCUMENT_ROOT'] . '/idx/inc/php/pages/search.php';

    ?>


    Also, I don't understand where it is I'm supposed to put the snippet beginning and snppet ending codes, since they're not used in the few snippet examples I've seen.

    Can I call someone on Monday to get help with this? It doesn't seem like it should be that hard since I get the principle behind the snippets, but getting started with them is turning out to be much harder than I thought.

    Thanks in advance for your help.
    Sharon Roark
    Keller Williams Bluegrass
    Lexington, KY
    859-433-3676
    www.LexingtonRealEstateSource.com

    As a life-long resident of Central Kentucky, I have extensive knowledge of real estate in Lexington, KY and of the surrounding areas. Let me put this market knowledge to work for you when buying or selling a home in Lexington, KY.

    Lexington Ky Real Estate Blog

    Home Staging in Lexington, KY

  5. #5
    Join Date
    Feb 2008
    Location
    Lexington, KY
    Posts
    157

    Default Re: Adding Snippets

    By the way, Vera, your explanation of what each line means was very helpful.

    Thanks,
    Sharon Roark
    Keller Williams Bluegrass
    Lexington, KY
    859-433-3676
    www.LexingtonRealEstateSource.com

    As a life-long resident of Central Kentucky, I have extensive knowledge of real estate in Lexington, KY and of the surrounding areas. Let me put this market knowledge to work for you when buying or selling a home in Lexington, KY.

    Lexington Ky Real Estate Blog

    Home Staging in Lexington, KY

  6. #6
    Join Date
    Apr 2004
    Location
    Nanaimo
    Posts
    16,026

    Default Re: Adding Snippets

    Sharon,
    I see that your IDX does actually exist on REW, however it seems to still be password protected, thus I don't think it is complete yet. It is located here: http://www.lexingtonrealestatesource.com/idx/ - you will not be able to use them until your IDX is complete and has passed compliance.

    As for Vera's tutorial - I apologize, I think she has mislead you here - she should not have pasted that tutorial as it was specific to another IDX users IDX (In another board) each board has it's own IDX snippets, what you need is help with "your" IDX snippets. CSR would be happy to provide telephone or email support once your IDX is signed off and complete. This link should prove useful to you http://www.realestatewebmasters.com/...ng-started.php

    Have a nice weekend.
    Starting LEC 7 soon but it won't be called LEC 7 - LEC 2012 coming soon!

  7. #7
    Join Date
    Feb 2008
    Location
    Lexington, KY
    Posts
    157

    Default Re: Adding Snippets

    Thanks for the update. Knowing customer service will help me with adding snippets is a huge relief. It appears the most successful REW sites use them extensively and I want to add quite a few to my site (as soon as I figure out how!)

    Thanks again.
    Sharon Roark
    Keller Williams Bluegrass
    Lexington, KY
    859-433-3676
    www.LexingtonRealEstateSource.com

    As a life-long resident of Central Kentucky, I have extensive knowledge of real estate in Lexington, KY and of the surrounding areas. Let me put this market knowledge to work for you when buying or selling a home in Lexington, KY.

    Lexington Ky Real Estate Blog

    Home Staging in Lexington, KY

  8. #8
    Join Date
    Mar 2006
    Location
    TEXAS
    Posts
    1,467

    Default Re: Adding Snippets

    Another important note for when using IDX snippets, be sure to use the #snippet-top# and #snippet-bottom#. These snippets are used to wrap content in so it will only display on the main area page.
    This gets rid of duplicate content on the price range pages or the rest of the listing result pages.
    So these same snippets work on the CMS1, I just noticed that my IDX is showing duplicate content on about 100 pages

  9. #9
    Join Date
    Aug 2006
    Location
    Fort Worth texas
    Posts
    4,941

    Default Re: Adding Snippets

    Can someone explain this to me. I think i am in the same boat as rich
    Looking for Real Estate, Investments, Condos in Dallas-Fort Worth-Denton-Keller-Haslet-North Texas Area. We have you covered, 400 New Homes and 60,000 Pre-owned home. Mike Pannell 817-703-3238
    Dallas Texas Real Estate | Fort Worth Texas Real Estate | Dallas Real Estate

    And remember...Nu Home Source Realty Rebates 20% of earned commissions back to the buyer!

  10. #10
    Aaron is online now Real Estate Webmasters Staff Aaron's Most Recent Blog Entry: Email etiquette Aaron is on a distinguished road
    Join Date
    Jun 2005
    Location
    Nanaimo
    Posts
    24,278

    Default Re: Adding Snippets

    Aaron
    Real Estate Webmasters ( Programming )
    Client Resources | Tutorials | Suggested Enhancements

+ Reply to Thread

Similar Threads

  1. Snippets no longer working
    By David Abernathy in forum REW IDX
    Replies: 1
    Last Post: 05-16-2008, 07:19 AM
  2. adding snippets
    By jimmclane in forum REW CMS 2 Questions
    Replies: 1
    Last Post: 04-07-2008, 07:46 PM
  3. Snippets with parameters?
    By RonnieG in forum REW IDX
    Replies: 0
    Last Post: 02-15-2008, 10:30 AM
  4. Snippets, snippets who's got the snippets :)
    By jessiesc in forum REW IDX
    Replies: 14
    Last Post: 10-17-2007, 01:56 PM
  5. Google link snippets
    By loudog in forum Google
    Replies: 8
    Last Post: 09-12-2007, 09:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts