Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigation slot should be totally omit if there is no items in the context #30

Open
geohuz opened this issue May 27, 2015 · 1 comment

Comments

@geohuz
Copy link

geohuz commented May 27, 2015

If there is no items in the context, we still get a blank "place holder" in the page, that is mostly we don't need. I add several lines in the Navigation class, like below:

class Navigation(object):

def __init__(self, context, request):
    self.context = context
    self.request = request
    self.location = 'top'
    self.slot = getattr(self.request, 'kotti_slot', None)

    # added by georgehu, to cancel the slot totally when we get a
    # empty list of items
    items = get_children(self.context, self.request, self.location)

    if self.slot is not None and items:
        self.location = self.slot
@j23d
Copy link
Member

j23d commented Feb 26, 2016

With these additions the tests will fail currently. Have to have a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants