Results 1 to 6 of 6

Thread: different image for each property class search

  1. #1
    Join Date
    Aug 2008
    Posts
    3

    Default different image for each property class search

    I want to set a different image for each property class search on search_page_default.html. Here is what I have tried, but it is not working.

    I've found some code that should work; originally found on OR Support Forum, Templates-Help/Ideas/Discussions..."custom header for each page" posting. It's an old posting and the original author is possibly no longer on OR forums(?).

    (1) Is the problem passing the pclass[] array in the URL and accessing it using $_GET...should I be using %5B%5D in the URL or using some other method of accessing pclass?

    (2) Can you think of any other reasons why the code below would not work?

    In my Welcome page I use <a href="http...index.php?action=search_step_2&pclass[]=n"> where n is an integer that equals the property class.



    Code is added to search_page_default.html.

    <?php

    //start by checking if were viewing a property class
    if(isset($_GET['pclass[]']))
    {
    //we are! lets get the matching image
    $classimg = $_GET['pclass[]']; //assign the property class number
    $headerimg = '{template_url}/images/'.$classimg.'.jpg'; //make the image url
    }
    else
    //No property class, lets just view the main logo for the site
    {
    $headerimg = '{template_url}/images/logo.jpg'; //set this to your default site logo
    }
    //show the image
    echo '<img src="'.$headerimg.'" height="100" width="100">';
    ?>

    I've checked my images are in {template_url}/images/, that file extensions are .jpg and are in the format 1.jpg, 2.jpg etc. for each class.

    Thank you

  2. #2
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: different image for each property class search

    You could create a search result template for each property class? It's in the template area of the docs.

  3. #3
    Join Date
    Aug 2008
    Posts
    3

    Default Re: different image for each property class search

    Thanks pbflash,

    I took a look at using search_result_class_CLASSID.html. I don't think that will be the solution....

    For clarification, its not the search page -results- that the image needs to go on. Its an image on the level 2 search page itself. The appropriate class image image would appear when search_page_default.html is loaded, inside of the {templated_search_form}.

    For example,

    Click on the left navbar on RENTALS and get a search page with a logo/cartoon of apartments. Click on FARMS and get a logo/cartoon of a farm at the top of the search page.

    I think if we can solve this image issue, we could also provide class-customized text on the search page. For examples "Browse all listings in FARMS' and "Browse all listings in RENTALS" instead of the generic "Browse all listings in this category type".

    Thanks again!
    Last edited by charleigh; 08-07-2008 at 01:33 PM. Reason: Update

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: different image for each property class search

    On the same page in the docs where you saw search_result_class_CLASSID.html there is a similar method for the search page.

  5. #5
    Join Date
    Aug 2008
    Posts
    3

    Red face Re: different image for each property class search

    Thank you for being so polite. There should be a new acronym RT_M"C" for carefully. That works just great...
    Last edited by charleigh; 08-07-2008 at 10:36 PM. Reason: language

  6. #6
    Join Date
    Jun 2004
    Location
    Beauceville, Quebec, Canada
    Posts
    132

    Default Re: different image for each property class search

    wow thats sounds like a cool idea . did you get it to work charleigh?

Bookmarks

Posting Permissions

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