How to display current location?

ClassiBase classifieds script Forums Tips and tricks How to display current location?

Tagged: 

This topic contains 3 replies, has 1 voice, and was last updated by  ClassiBase 2 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1878 Reply

    Anderty

    i see, that in some places, functions are called, and they show to user, which location is curretly selected.

    So, how it shoulb be done, how can I echo location to visitor?

    #1887 Reply

    ClassiBase
    Keymaster

    With echoing current location there are two different cases:

    1. Current “active location” which users selected when navigating or pre selected by default. This stays same even when user views ad listed on other location. For echoing this you can use echo View::escape(Location::getName(IndexController::$selected_location));
    2. Location of current ad on ad page, which may be different from “active location” mentioned above. For this you can use echo View::escape(Location::getName(IndexController::$selected_ad->Location));

    Note that these are performed using internal variables and can change in future releases. So do not rely on them much.

    #1990 Reply

    giptree

    which page the codes are in?

    #1996 Reply

    ClassiBase
    Keymaster

    You can add as widget using text widget (select type as PHP in your widget settings) or in your theme folder /user-content/themes/THEME_NAME/layouts/frontend.php for example.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to display current location?
Your information:




This entry was posted on by .