Skip to content

Commit

Permalink
Breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Oct 24, 2019
1 parent 7c52384 commit 0f05477
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions content/collections/extending-docs/breadcrumbs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Breadcrumbs
id: a96676fe-0ec4-41f5-9205-2fe47988addb
intro: |
At the top of most pages in the control panel, you will see a title with breadcrumbs sitting above. Statamic provides
ways to generate these links without you having to worry about manually generating the HTML.
---
``` php
use Statamic\CP\Breadcrumbs;

$crumbs = Breadcrumbs::make([
['text' => 'First', 'url' => '/first'],
['text' => 'Second', 'url' => '/second'],
])

return view('myview', ['crumbs' => $crumbs]);
```

``` blade
<breadcrumbs :crumbs='@json($crumbs)'></breadcrumbs>
```

``` vue
<template>
<breadcrumbs :crumbs="crumbs" />
</template>
<script>
export default {
data()
return {
crumbs: [
['text' => 'First', 'url' => '/first'],
['text' => 'Second', 'url' => '/second'],
]
]
}
}
</script>
```
2 changes: 2 additions & 0 deletions content/structures/extending-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ tree:
entry: aa6e0a79-9d3f-493b-92c9-df4d2257bc64
-
entry: b4b46ceb-9feb-4587-8f0d-2080511bf9e3
-
entry: a96676fe-0ec4-41f5-9205-2fe47988addb
-
title: Javascript
children:
Expand Down

0 comments on commit 0f05477

Please sign in to comment.