Skip to content

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

Description

@geohuz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions