Skip Navigation

About:Editing Accommodation Tables

Travel Guide About:Index About:Editing Accommodation Tables

edit

Introduction

Accommodation listings in the guide can be a bit daunting to edit for those new to the process. Tables are used to render the listings as a way of making them more legible for readers. This is particularly important in large cities which can sometimes have hundreds of listings. The tabular format allows people to sort accommodation by their name, type and (if they are bookable on Travellerspoint) their popularity rating.

So the first thing to understand is how tables are structured in the code.

Important: You can only create one accommodation table on a page.

Top

edit

Tables

The basic code wrapping the tables are these tags.

{|
.. (table here)
|}

New rows in the table are separated by a pipe and hyphen : |-

{|
|-
.. (row 1)
|-
.. (row 2)
|}

Each column in the row is separated with double pipes and with a single pipe at the start of the row.

{|
|-
| (row 1, column 1) || (row 1, column 2)
|-
| (row 2, column 1) || (row 2, column 2)
|}

Headers for the table are almost the same, except exclamation marks are used instead of pipes.

{|
|-
! (header column 1} !! (header column 2}
|-
| (row 1, column 1) || (row 1, column 2)
|}

Those are the basics behind table formatting and can be used anywhere in the guide where a table format is desirable.

Top

edit

Accommodation Tables

Accommodation tables are handled slightly differently to ensure that we know they are accommodation listings. They enable the sorting to work correctly.

Firstly, you need to ensure the table includes the word "Accommodation" to identify it just after the opening of the table. Like this:

{| Accommodation
|-
! (header column 1} !! (header column 2}
|-
| (row 1, column 1) || (row 1, column 2)
|}

Now that we know it's an accommodation table, we also know to treat some headers differently. Any header can be used in the table, but these are the main ones of interest:

  • TPID - This is the Travellerspoint ID for this property. If this is available, then we can automatically show an up-to-date popularity rating for this property. If a property is not listed on Travellerspoint, then leave this blank. Usually if you are manually adding properties, you will be leaving this blank. We will automatically add in TPIDs when we have them.
  • Property - The name of the property
  • Address -The property's address
  • Type - The type of accommodation: Hotel, Hostel, Guesthouse, Apartment, Camping, etc.
  • Latitude - This is not shown to the user at the moment, but is added in here since it will be used in the future.
  • Longitude - This is not shown to the user at the moment, but is added in here since it will be used in the future.

With all these headers in place, your table will look like this:

{| Accommodation
|-
! TPID !! Property !! Address !! Type !! Latitude !! Longitude
|-
| (row 1, TPID) || (row 1, Property) || (row 1, Address) || (row 1, Type) || (row 1, Latitude) || (row 1, Longitude)
|}

To add a listing, add a row to the table and fill in the details at the right spot:

{| Accommodation
|-
! TPID !! Property !! Address !! Type !! Latitude !! Longitude
|-
| 10761 || Flying Pig Downtown || Nieuwendijk 100 1012 MR || Hostel || 52.3766240000000 || 4.8963847000000
|}

That will produce this table

PropertyAddressTypePopularity
Flying Pig DowntownNieuwendijk 100 1012 MRHostel87

This is a good time to point out that even if all the headers exist, they are not required. If you don't know the address, or latitude / longitude details, then you can leave them blank. To leave a column blank, be sure to still keep the dividers (||) in place so we know to move on to the next column. For example, this table leaves out the address (note 4 pipes in a row where the column was left out) :

{| Accommodation
|-
! TPID !! Property !! Address !! Type !! Latitude !! Longitude
|-
| 10761 || Flying Pig Downtown || || Hostel || 52.3766240000000 || 4.8963847000000
|}

If you are leaving a column blank at the end of the table, then you don't need to bother with this since there's nothing afterwards. So this table leaves out the address AND the latitude/ longitude and will process fine.

{| Accommodation
|-
! TPID !! Property !! Address !! Type !! Latitude !! Longitude
|-
| 10761 || Flying Pig Downtown || || Hostel
|}

The most likely thing you will be leaving out though is the TPID. That would end up like this:

{| Accommodation
|-
! TPID !! Property !! Address !! Type !! Latitude !! Longitude
|-
| || Flying Pig Downtown || || Hostel
|}

Note: there are only three pipes before the name of the hostel. One to start the row and two to separate the first (blank) column from the next.

Top

edit

Automatically Generated Accommodation Tables

In general, there is often little need to create these accommodation tables from scratch. When editing your article, you can use a special function to help build the table.

Under the editing form, you will see a link to "Generate Accommodation Table". Clicking on it brings up a popup listing the countries and cities that Travellerspoint has accommodation in. If you select one of those it will generate a table for you that you can then just copy and paste into the article.

If you need to add more rows to that table, then that can of course be done, but at least the basic structure is all laid out for you.

Contributors

Help contribute to this article to share the ad revenue.

About:Editing Accommodation Tables Travel Helpers

We don't currently have any Travel Helpers for About:Editing Accommodation Tables

This is version 2. Last edited at 21:14 on Feb 12, 10 by Peter. 1 article links to this page.

Creative Commons License
Except where otherwise noted, content of this article is licensed under a Creative Commons Attribution-ShareAlike 3.0 License