İçeriğe geç

Ghost

Bu içerik henüz dilinizde mevcut değil.

Ghost’s built-in Code Injection feature lets you add scripts to the global <head> and </body> of your publication. All Ghost plans support code injection, making it easy to embed Wink components on any page or post.

  1. In the Ghost Admin panel, go to Settings → Code Injection.
  2. In the Site Header box, add the stylesheet:
    <link rel="stylesheet" href="https://elements.wink.travel/styles.css">
  3. In the Site Footer box, add the script and application loader (replace YOUR_CLIENT_ID):
    <script src="https://elements.wink.travel/elements.js" type="module" defer></script>
    <wink-app-loader client-id="YOUR_CLIENT_ID"></wink-app-loader>
  4. Click Save.

Ghost’s editor supports an HTML card that lets you insert raw HTML anywhere in your content.

  1. Open the post or page in the Ghost editor.
  2. Type / to open the card picker and select HTML.
  3. Paste the component HTML, for example:
    <wink-content-loader
    layout="HOTEL"
    id="YOUR_LAYOUT_ID"
    ></wink-content-loader>
  4. Click outside the card to preview, then publish.

For a component that should only appear on one page, Ghost also supports per-page code injection:

  1. Open the post or page settings (gear icon in the editor).
  2. Scroll to Code Injection.
  3. Add the component tag in the Footer field (the global app-loader only needs to be in the site-wide footer).
  4. Save.
ComponentHTML tagPurpose
Content loader<wink-content-loader>Display hotel cards, grids, maps
Lookup<wink-lookup>Search bar for destinations
Search button<wink-search-button>Open itinerary picker
Account button<wink-account-button>Sign in / user menu
Itinerary button<wink-itinerary-button>Show current itinerary
Itinerary picker<wink-itinerary-picker>Full itinerary form
Shopping cart<wink-shopping-cart-button>Cart summary button

See Web Components for the full attribute reference.