Skip to content

Commit

Permalink
Exclude navigation config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Sep 21, 2020
1 parent 40140cf commit a1b0f8d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const settings = {
...config.settings,
navDepth: 5,
providerUrl: 'https://discodata.eea.europa.eu/sql',
excludeFromNavigation: ['/industrial-site'],
};

export const views = {
Expand Down
49 changes: 26 additions & 23 deletions src/customizations/volto/components/theme/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,29 +166,32 @@ class Navigation extends Component {
}
onClick={this.closeMobileMenu}
>
{this.props.items.map((item) => (
<NavLink
to={item.url === '' ? '/' : item.url}
key={item.url}
className="item"
activeClassName="active"
onClick={() => {
if (
!item.url.includes('/industrial-site') &&
!item.url.includes('/analysis')
) {
this.props.resetQueryParam();
}
}}
exact={
settings.isMultilingual
? item.url === `/${lang}`
: item.url === ''
}
>
{item.title}
</NavLink>
))}
{this.props.items.map(
(item) =>
!settings.excludeFromNavigation.includes(item.url) && (
<NavLink
to={item.url === '' ? '/' : item.url}
key={item.url}
className="item"
activeClassName="active"
onClick={() => {
if (
!item.url.includes('/industrial-site') &&
!item.url.includes('/analysis')
) {
this.props.resetQueryParam();
}
}}
exact={
settings.isMultilingual
? item.url === `/${lang}`
: item.url === ''
}
>
{item.title}
</NavLink>
),
)}
</Menu>
</nav>
);
Expand Down

0 comments on commit a1b0f8d

Please sign in to comment.