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

SlotsInformation, has_portlets and show="False" #19

Open
pierreNomazy opened this issue May 22, 2014 · 0 comments
Open

SlotsInformation, has_portlets and show="False" #19

pierreNomazy opened this issue May 22, 2014 · 0 comments

Comments

@pierreNomazy
Copy link

Try a category with only the Filter portlet in one portlet. Then look at one or many products of this category. The bug (offset in slot) cames from the function 'has_portlets' in
lfs-theme / lfs_theme / templatetags / lfs_theme_tags.py. In this case 'has_portlet' is True because parent of the product = category has one portlet, but the rendered of this portlet is empty with show="False" in the product.
To fix it, I suggest to remove 'has_portlet' by a new function : has_portlets_rendered
def has_portlets_rendered(obj, slot,context):
portlets_list = []
rendered_list = ''
while obj:
portlets_list = portlets.utils.get_portlets(obj, slot)
for p in portlets_list:
rendered_list = (''.join(p.render(context)))
if len(rendered_list.strip()) > 0:
return True
if portlets.utils.is_blocked(obj, slot):
break
try:
obj = obj.get_parent_for_portlets()
except AttributeError:
break

return False    
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

1 participant