Skip to content

Commit 41b05b2

Browse files
authored
Merge pull request #34 from Sean-OShea/Sean-OShea-readme-fix
Added field context in yaml + fixed nav output
2 parents 5382b44 + 2243e30 commit 41b05b2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ Copy plugin files to your plugin's directory. Use the following blueprint anywhe
2323
Add the following blueprint to wherever you would like the navigation field to appear.
2424

2525
```yaml
26-
navigation:
27-
label: Navigation
28-
type: navigation
29-
levels: 5
30-
help: Description of menu or where it is used
31-
width: 1/2
26+
fields:
27+
navigation:
28+
label: Navigation
29+
type: navigation
30+
levels: 5
31+
help: Description of menu or where it is used
32+
width: 1/2
3233
```
3334
3435
Two Field methods are included which will output the menu regardless of how many levels deep you go:
@@ -68,9 +69,11 @@ If you would like full control of your menu and would prefer to use a foreach to
6869
<?php if($nav->children()->isNotEmpty()): ?>
6970
<ul>
7071
<?php foreach($nav->children()->toStructure() as $child): ?>
71-
<a href="<?php echo $child->url() ?>">
72-
<?php echo $nav->text() ?>
73-
</a>
72+
<li>
73+
<a href="<?php echo $child->url() ?>">
74+
<?php echo $child->text() ?>
75+
</a>
76+
</li>
7477
<?php endforeach ?>
7578
</ul>
7679
<?php endif ?>

0 commit comments

Comments
 (0)