The Destination Menu feed collects all the relevant Guide, Event and POI information for a given Location and returns a structured set of links that can be used to build a menu, much like on frommers.com. It also has the ability to receive contextual IDs to automatically show or hide parts of the menu.
Destination Menu
For more information, browse the Destination Menu API
- Introduction
- Planning a Trip
- Visitor Information
- When to Go
- Calendar of Events
- Getting There
- Escorted & Package Tours
- Money
- Entry Requirements & Customs
- Sustainable Travel & Ecotourism
- Health & Safety
- Tips for Families
- Tips for Gay and Lesbian Travelers
- Tips for Senior Travelers
- Tips for Student Travelers
- Tips for Travelers with Disabilities
- Staying Connected
- Getting to Know
- Hotel
- Restaurant
- Attraction
- Nightlife
- Shopping
- In Depth
- Side Trips
- Walking Tours
- Active Pursuits
- Spectator Sports
- Suggested Itineraries
- Events
Request:
http://demosite.frommers.biz/frommers/destination_menu.feed?guideStructureId=250088&autoHide=true
Response:
<destinationMenu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="feedschema/base.xsd" locationId="153446" name="Tokyo">
<destinationLinks>
<destinationLink name="Introduction" feedCode="guide_structure" feedQuery="guideStructureId=250087" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250087"/>
<destinationLink name="Planning a Trip" feedCode="guide_structure" feedQuery="guideStructureId=250088" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250088">
<children>
<destinationLink name="Visitor Information" feedCode="guide_structure" feedQuery="guideStructureId=250104" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250104"/>
<destinationLink name="When to Go" feedCode="guide_structure" feedQuery="guideStructureId=250106" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250106"/>
<destinationLink name="Calendar of Events" feedCode="guide_structure" feedQuery="guideStructureId=250160" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250160"/>
<destinationLink name="Getting There" feedCode="guide_structure" feedQuery="guideStructureId=250107" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250107"/>
<destinationLink name="Escorted & Package Tours" feedCode="guide_structure" feedQuery="guideStructureId=250134" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250134"/>
<destinationLink name="Money" feedCode="guide_structure" feedQuery="guideStructureId=250105" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250105"/>
<destinationLink name="Entry Requirements & Customs" feedCode="guide_structure" feedQuery="guideStructureId=555325" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=555325"/>
<destinationLink name="Sustainable Travel & Ecotourism" feedCode="guide_structure" feedQuery="guideStructureId=555331" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=555331"/>
<destinationLink name="Health & Safety" feedCode="guide_structure" feedQuery="guideStructureId=250148" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250148"/>
<destinationLink name="Tips for Families" feedCode="guide_structure" feedQuery="guideStructureId=250155" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250155"/>
<destinationLink name="Tips for Gay and Lesbian Travelers" feedCode="guide_structure" feedQuery="guideStructureId=250156" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250156"/>
<destinationLink name="Tips for Senior Travelers" feedCode="guide_structure" feedQuery="guideStructureId=250157" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250157"/>
<destinationLink name="Tips for Student Travelers" feedCode="guide_structure" feedQuery="guideStructureId=250158" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250158"/>
<destinationLink name="Tips for Travelers with Disabilities" feedCode="guide_structure" feedQuery="guideStructureId=250159" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250159"/>
<destinationLink name="Staying Connected" feedCode="guide_structure" feedQuery="guideStructureId=250161" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250161"/>
</children>
</destinationLink>
<destinationLink name="Getting to Know" feedCode="guide_structure" feedQuery="guideStructureId=250089" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250089"/>
<destinationLink name="Hotel" feedCode="poi_search" feedQuery="showMax=true&type=HOTEL&locationId=153446" url="http://demosite.frommers.biz/frommers/poi_search.feed?showMax=true&type=HOTEL&locationId=153446"/>
<destinationLink name="Restaurant" feedCode="poi_search" feedQuery="showMax=true&type=RESTAURANT&locationId=153446" url="http://demosite.frommers.biz/frommers/poi_search.feed?showMax=true&type=RESTAURANT&locationId=153446"/>
<destinationLink name="Attraction" feedCode="poi_search" feedQuery="showMax=true&type=ATTRACTION&locationId=153446" url="http://demosite.frommers.biz/frommers/poi_search.feed?showMax=true&type=ATTRACTION&locationId=153446"/>
<destinationLink name="Nightlife" feedCode="poi_search" feedQuery="showMax=true&type=NIGHTLIFE&locationId=153446" url="http://demosite.frommers.biz/frommers/poi_search.feed?showMax=true&type=NIGHTLIFE&locationId=153446"/>
<destinationLink name="Shopping" feedCode="poi_search" feedQuery="showMax=true&type=SHOPPING&locationId=153446" url="http://demosite.frommers.biz/frommers/poi_search.feed?showMax=true&type=SHOPPING&locationId=153446"/>
<destinationLink name="In Depth" feedCode="guide_structure" feedQuery="guideStructureId=250093" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250093"/>
<destinationLink name="Side Trips" feedCode="guide_structure" feedQuery="guideStructureId=250092" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250092"/>
<destinationLink name="Walking Tours" feedCode="guide_structure" feedQuery="guideStructureId=250091" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250091"/>
<destinationLink name="Active Pursuits" feedCode="guide_structure" feedQuery="guideStructureId=555324" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=555324"/>
<destinationLink name="Spectator Sports" feedCode="guide_structure" feedQuery="guideStructureId=250094" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250094"/>
<destinationLink name="Suggested Itineraries" feedCode="guide_structure" feedQuery="guideStructureId=250090" url="http://demosite.frommers.biz/frommers/guide_structure.feed?guideStructureId=250090"/>
<destinationLink name="Events" feedCode="event_search" feedQuery="locationId=153446" url="http://demosite.frommers.biz/frommers/event_search.feed?locationId=153446"/>
</destinationLinks>
</destinationMenu> Call the feed URL, using curl
$ch = curl_init(); // Set up curl
curl_setopt($ch, CURLOPT_URL, $url); // Add url
curl_setopt($ch, CURLOPT_HEADER, 0); // Remove header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return data
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Set timeout, 10s
$response = curl_exec($ch); // Call feed
curl_close($ch); // Close curl, free resources
Convert response to XML, use xpath to get list of destinations
$xml = new SimpleXMLElement($response); // Create xml object
$destinationLinks = $xml->xpath("//destinationLinks/destinationLink");; //Use xpath to get list of destination links
Build output dynamically by iterating destination links
<div class="destinationMenu">
<ul>
<?php foreach ($destinationLinks as $destinationLink ) { ?>
<li><a href="#"><?php echo $destinationLink["name"];?></a>
<?php if ($destinationLink->children) {?>
<ul>
<?php foreach ($destinationLink->children->destinationLink as $destinationLink ) { ?>
<li><a href="#"><?php echo $destinationLink["name"];?></a></li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
Loading...
