Different Views for Different Categories

This topic contains 4 replies, has 3 voices, and was last updated by  Stiofan O’Connor 9 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #20342

    krischin
    Free User
    Post count: 18

    Hello,

    How can I have a different view for different category. For example, List View for Restaurants, Grid 3 for Hotels, Grid 2 for Attractions, etc. I feel it would give my site more variety instead of just having one view. I plan on hiding the box which allows users to choose the view.

    Thanks,

    #20343

    Simone
    Expired Member
    Post count: 3515

    Hello, this is not natively possible, if you are confident with PHP, this would be doable with some conditions set in the geodirectory_template_actions.php file

    #20344

    krischin
    Free User
    Post count: 18

    Thanks for the quick reply. I have PHP basic skills, but any advice on specific lines of code to modify would be greatly appreciated. I feel this is something that would be relatively easy to implement and may users would find useful. Kudos on the great plugin…

    #20347

    Simone
    Expired Member
    Post count: 3515

    I think you should play with the geodirectory_functions/custom_functions.php file, around row 31 where it says

    <option value="1" <?php if($sel=='1'){echo 'selected="selected"';}?> ><?php _e('View: List',GEODIRECTORY_TEXTDOMAIN);?></option>
    #20381

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    This could get complicated, for me i would start by writing a function to conrol the session. The views use a session

    $_SESSION['gd_listing_view']

    which can be 1,2,3,4 or 5.

    You could write a function to get the current category and set it as desired.

    Stiofan

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket