Skip to content

Instantly share code, notes, and snippets.

@madebysofa
Created February 2, 2010 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madebysofa/292585 to your computer and use it in GitHub Desktop.
Save madebysofa/292585 to your computer and use it in GitHub Desktop.
<h4>Menus Resource</h4>
<h6>URL Endpoints</h6>
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<th>Endpoint</th>
<th>Supported Metods</th>
</tr>
<tr>
<td>/[handle]/api/v2/webstore/menus.json</td>
<td>GET</td>
</tr>
<tr>
<td>/[handle]/api/v2/webstore/menus/[menu-name].json</td>
<td>GET, PUT, DELETE</td>
</tr>
</table>
<h6>Data Structure</h6>
<p>
The menus in the menu resource are named collections of structured menus. They can go multiple levels deep, but please note that some of the templates only render the menus up to two levels of depth. The correct urls for the menu items will be generated when rendering the template, for example the url <span class="code">"tags:man,bikes"</span> could become <span class="code">/store-name/shop/browse/man,bikes/1</span>.
</p>
<div class="code-example">
<span class="method">GET</span>
<span class="endpoint">/[handle]/api/v2/webstore/menu/navigation.json</span>
<span class="file">/static/support/documentation/examples/menu.json</span>
</div>
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<th>Name</th>
<th>Path</th>
<th>Type</th>
<th>Description</th>
<th>Example</th>
<th>Notes</th>
</tr>
<tr>
<td>name</td>
<td class="path">name</td>
<td>string</td>
<td>Menu name</td>
<td>"navigation", "product", "footer"</td>
<td>By default templates expect "navigation" and "product" menu to be available.</td>
</tr>
<tr>
<td>menu</td>
<td class="path">menu</td>
<td>list with dictionaries</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="sublevel1">title</td>
<td class="path">menu.0.title</td>
<td>string</td>
<td>Name as it would appear on the site</td>
<td>"License Agreement", "Apple Website", "Bikes for Men"</td>
<td></td>
</tr>
<tr>
<td class="sublevel1">url</td>
<td class="path">menu.0.url</td>
<td>special string</td>
<td>Location the menu should point to</td>
<td>"page:agreement", "url:http://www.apple.com", "tags:man,bikes"</td>
<td>The urls can be of types url:[link], page:[page resource url], tags:[list of tags separated by comma]. If using tags or pages, make sure they exist.</td>
</tr>
<tr>
<td class="sublevel1">submenus</td>
<td class="path">menu.0.link</td>
<td>list with dictionaries</td>
<td>List with more menu resources</td>
<td></td>
<td></td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment