Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Jul 17, 2018
2 parents 6354c10 + 80c48d0 commit c2bcf92
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ For more fine-grained control over the navigation output, you can call nodes dir
</ul>
```

### Node attributes
## Node attributes

You have access to the following attributes on navigation nodes. These are also available when querying node elements.

### Parameters
#### Parameters

| Parameter | Explanation |
| --------- | ----------- |
Expand All @@ -114,7 +114,21 @@ You have access to the following attributes on navigation nodes. These are also
| newWindow | Whether this node should open in a new window. |
| active | Whether the URL matches the current URL. |
| nav | The navigation model this node belongs to. |
| status | The current status of the node. |
| children | A collection of child nodes (if any). |

## Node queries

As nodes are just elements, you can query nodes as per your needs. See [Element Queries](https://docs.craftcms.com/v3/dev/element-queries/#creating-element-queries) and [Entry Queries](https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html).

Some common query parameters:

#### Parameters
| Parameter | Explanation |
| --------- | ----------- |
| hasDescendants | Whether the current node has any children |
| level | The level in the navigation structure this node belongs to. |
| status | The current status of the node. |

## Developers

Expand Down
2 changes: 1 addition & 1 deletion src/elements/db/NodeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function handle($value)
protected function beforePrepare(): bool
{
$this->joinElementTable('navigation_nodes');
$this->subQuery->innerJoin('{{%navigation_navs}}', '[[navigation_nodes.navId]] = [[navigation_navs.id]]');
$this->subQuery->innerJoin('{{%navigation_navs}} navigation_navs', '[[navigation_nodes.navId]] = [[navigation_navs.id]]');

$this->query->select([
'navigation_nodes.*',
Expand Down

0 comments on commit c2bcf92

Please sign in to comment.