How to configure the tabs

By default, widget tabs is equals to the search page but you can change aspect, position, hide/show activities and duplicate tab activities with different configurations.

Define tabs to appear in widget

The attribute data-search-widget can hold tabs you want to show and respective order, like this:

<div data-search-widget="lodge,flights,packages"></div>

List of activities available:

  • lodge
  • insurance
  • flights
  • services
  • packages
  • rentacar
  • transfers

Create a duplicated tab

It's simple only need to repeat activity in widget declaration.

<div data-search-widget="lodge,flights,packages,lodge"></div>

Widget duplicated tab

Change second lodge tab template

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge"></div>

Widget duplicated tab

Create a configuration group for tab index 3 (second lodge tab). Configuration group is represented with attribute data-tab-target="3" and respective tab index value.

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge">
    <div data-tab-target="3"></div>
</div>

Insert all configurations (modified templates and tab parameters) inside the element <div data-tab-target="3"></div>.

Example: Create a Lisbon Hotels tab

Widget base definition:

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge"></div>

Change the second lodge tab title

First we need the corresponding template, for this open page of all tabs templates, and find the search-lodge-tab-head-template, this is the template we want. Copy template source, past inside the element <div data-tab-target="3"> and change the title to 'Lisbon Hotels'.

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge">
    <div data-tab-target="3">
        <!-- template lodge header -->
        <script 
            type="text/template" 
            data-mvc-template="search-lodge-tab-head-template">
                <li title="Lisbon Hotels">
                    <a href="#">Lisbon Hotels</a>
                </li>
        </script>
    </div>
</div>

Widget Lisbon Hotels

Configure some parameters

It's the same for all search activities, find JSON Object and replace all values you want.

List of JSON Objects for each search activity:

Lodge JSON Object:

    {
      "geoTo": "",
      "geoToValue": "",
      "dateFrom": "",
      "dateTo": "",
      "infrastructureName": "",
      "classification": "",
      "foodPlan": "",
      "immediateAvailability": false,
      "paxSelection": [
        {
          "children": [],
          "adults": "1"
        }
      ]
    }

For this example, we want to change the geo area of the lodge search form and rooms configurations. Inside group configurations index 3 insert part of JSON Object we want to replace. In this case change geoTo to Lisbon, geoToValue to 44599 (it's a id of Lisbon area) and change paxSelection to add two rooms, in the first add one adult and second add two adults and one infant.

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge">
    <div data-tab-target="3">
        <!-- template lodge header -->
        <script 
            type="text/template" 
            data-mvc-template="search-lodge-tab-head-template">
                <li title="Lisbon Hotels">
                    <a href="#">Lisbon Hotels</a>
                </li>
        </script>
        <!-- lodge form parameters -->
        <script type="text/json" data-mvc-json="parameters">
            { "geoTo": "Lisbon", "geoToValue": "44599", 
                "paxSelection":[
                    {"adults": "1", "children": []},
                    {"adults": "2", "children": ["0"]}
                ] 
            }
        </script>
    </div>
</div>

Widget duplicated

Apply some template changes

Change form title "Hotels Search" to "Lisbon Hotels Search" and hide 'To' field because it is always 'Lisbon':

<!--     tab index     =   0  ,   1   ,   2    , 3  -->
<div data-search-widget="lodge,flights,packages,lodge">
    <div data-tab-target="3">
        <!-- template lodge header -->
        <script 
            type="text/template" 
            data-mvc-template="search-lodge-tab-head-template">
                <li title="Lisbon Hotels">
                    <a href="#">Lisbon Hotels</a>
                </li>
        </script>
        <!-- lodge form parameters -->
        <script type="text/json" data-mvc-json="parameters">
           { "geoTo": "Lisbon", "geoToValue": "44599", 
                "paxSelection":[
                    {"adults": "1", "children": []},
                    {"adults": "2", "children": ["0"]}
                ] 
            }
        </script>
        <!-- template lodge form -->
        <script type="text/template" data-mvc-template="search-lodge-tab-body-template">
            <form id="form-search-lodge-<%- index%>" class="lodge-search-box position-relative">
                <div class="search-box-title">Lisbon Hotels Search</div>
                <div class="search-box">
                    <div class="search-box-landing">
                        <div class="table total-width">
                            <div class="hide" class="search-box-item table-cell" style="width: 60%">
                                <input name="geoToValue" class="icon-input-pin" type="text" placeholder="<%- t('search.lodge.geo')%>">
                            </div>
                            <div class="search-box-item table-cell" style="width: 50%">
                                <input name="dateFrom" type="text" class="icon-input-calendar">
                            </div>
                            <div class="search-box-item table-cell" style="width: 50%">
                                <input name="dateTo" type="text" class="icon-input-calendar">
                            </div>
                        </div>

                        <div class="table total-width">
                            <div class="search-box-item table-cell" style="width: 34%">
                                <input type="text" name="roomsInfo" id="lodge-room-selection" class="icon-input-room">
                            </div>
                            <div class="search-box-item table-cell" style="width: 18%">
                                <input type="text"  name="classification" placeholder="<%- t('search.lodge.anystar')%>" id="lodge-stars" class="icon-input-star cursor-pointer">
                            </div>
                            <div class="search-box-item table-cell" style="width: 18%">
                                <input type="text" name="foodPlan" placeholder="<%- t('search.lodge.anyfoodplan')%>" class="icon-input-food cursor-pointer">
                            </div>
                            <div class="search-box-item table-cell" style="width: 30%">
                                <div class="btn btn-primary btn-block btn-search" id="do-lodge-search"><i class="icon-search icon-white"></i> <%- t('search.submit')%></div>
                            </div>
                        </div>

                        <div class="search-more-options js-advanced-options"><%- t("advanced.options")%> <i class="icon-dropdown-toggle-small white pull-right"></i> </div>
                        <div class="js-advanced-item table total-width">
                            <div class="search-box-item table-cell" style="width: 30%">
                                <input type="text" name="infrastructureName" class="icon-input-hotel" placeholder="<%- t('search.lodge.infrastructurename')%>">
                            </div>
                            <div class="search-box-item table-cell" style="width: 30%">
                                <input type="checkbox" name="immediateAvailability" id="immediateAvailability<%- index%>" value="">
                                <label for="immediateAvailability<%- index%>"><%- t('search.lodge.availability')%></label>
                            </div>
                            <div class="search-box-item table-cell" style="width: 40%">

                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </script>
    </div>
</div>

Widget Lisbon Hotels

Note: More information about change templates here.

results matching ""

    No results matching ""