1

I'm working on a site with hundreds of imported pages. Many of them won't be in a menu and are findable by using site search. We have a contextual sidebar menu in the left column and when these non-assigned pages are viewed, the left column is empty.

I'd like to add a default menu (and breadcrumbs) for any un-assigned page. Is there a way to detect if a page isn't in a menu and use a conditional to load a default if no match is found?

1

I don't think if there is such a tag in NavEE so that you can check that current page is from the navigation of NavEE module. But you can try SQL with query module like:

{exp:query sql="SELECT COUNT(*) AS total_navs FROM exp_navee WHERE link LIKE '%{current_path}%'"}

{if total_navs == 0}

###### 
code
######

{/if}

{/exp:query}

{current_path} is standard global variable (http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#current-path)

I hope, it would work for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.