Jump to content
Toggle menu
  • 47 articles
  • 2 files
  • 2 users
  • 195 edits
Virginia.wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Book destination: Difference between revisions

Template page
Created page with "<includeonly> {{#ifexist:Template:Destination affiliate/{{{destination|}}} |<!-- DESTINATION RECORD EXISTS --> {{#if: {{Destination affiliate/{{{destination}}}|hotels}} {{Destination affiliate/{{{destination}}}|activities}} {{Destination affiliate/{{{destination}}}|cars}} | <div class="vw-book-destination"> <div class="vw-book-kicker"> PLAN YOUR VISIT </div> <div class="vw-book-title"> Plan a trip to {{{name|{{Destination affiliate/{{{destination}}}|name}}}}} </div>..."
 
Install Virginia.wiki destination-commerce fallback architecture
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>{{#ifexist:Template:Destination affiliate/{{{destination|}}}
{{#ifexist:Template:Destination affiliate/{{{destination|}}}
|{{Book destination record
 
  |record={{{destination}}}
|<!-- DESTINATION RECORD EXISTS -->
  |name={{{name|}}}
 
  }}
{{#if:
|{{#ifexist:Template:Destination affiliate/default
{{Destination affiliate/{{{destination}}}|hotels}}
  |{{Book destination record
{{Destination affiliate/{{{destination}}}|activities}}
    |record=default
{{Destination affiliate/{{{destination}}}|cars}}
    |name={{{name|}}}
 
    }}
|
  }}
<div class="vw-book-destination">
}}</includeonly>
 
<div class="vw-book-kicker">
PLAN YOUR VISIT
</div>
 
<div class="vw-book-title">
Plan a trip to {{{name|{{Destination affiliate/{{{destination}}}|name}}}}}
</div>
 
<div class="vw-book-grid">
 
{{#if:{{Destination affiliate/{{{destination}}}|hotels}}|
<div class="vw-book-item">
<div class="vw-book-item-title">Places to stay</div>
<div class="vw-book-item-text">Compare hotels and other accommodations.</div>
<div class="vw-commerce-button">
[{{Destination affiliate/{{{destination}}}|hotels}} Find hotels]
</div>
</div>
}}
 
{{#if:{{Destination affiliate/{{{destination}}}|activities}}|
<div class="vw-book-item">
<div class="vw-book-item-title">Things to do</div>
<div class="vw-book-item-text">Find tours, tickets and experiences.</div>
<div class="vw-commerce-button">
[{{Destination affiliate/{{{destination}}}|activities}} Find activities]
</div>
</div>
}}
 
{{#if:{{Destination affiliate/{{{destination}}}|cars}}|
<div class="vw-book-item">
<div class="vw-book-item-title">Getting around</div>
<div class="vw-book-item-text">Compare rental-car options for your trip.</div>
<div class="vw-commerce-button">
[{{Destination affiliate/{{{destination}}}|cars}} Find a car]
</div>
</div>
}}
 
</div>
 
{{Affiliate disclosure}}
 
</div>
 
|<!-- DESTINATION EXISTS BUT HAS NO ACTIVE COMMERCIAL LINKS -->
}}
 
|<!-- NO DESTINATION RECORD: RENDER NOTHING -->
}}
</includeonly>


<noinclude>
<noinclude>
== Usage ==
== Usage ==
Articles use only the destination ID:
<pre>
<pre>
{{Book destination
{{Book destination
Line 76: Line 20:
}}
}}
</pre>
</pre>
 
A destination-specific record is preferred. If it does not exist, the sitewide default affiliate record is used.
Affiliate URLs are stored separately under:
 
<pre>
Template:Destination affiliate/VA-WILLIAMSBURG
</pre>
 
The article writer should never insert affiliate URLs directly.
</noinclude>
</noinclude>

Latest revision as of 06:35, 17 October 2026


Usage

{{Book destination
 |destination=VA-WILLIAMSBURG
 |name=Williamsburg
}}

A destination-specific record is preferred. If it does not exist, the sitewide default affiliate record is used.