def get_content_width(self): """Returns the max-width of the content, determined by evaluating the full_size image scale. """ # scale name depends on layout (two columns etc.) # use the scale name of the full_size of the current # layout for determining the maximum width of the block scale_name = SlUtils().getSizeAttributesByInterface( self.context, 'full_size') # the size_config contains the width for each scale for name, iface in CONFIGLET_INTERFACE_MAP.items(): size_config = queryUtility(iface, name=name) if hasattr(size_config, scale_name): return getattr(size_config, scale_name) return 0
from simplelayout.base.config import ( SLOT_INTERFACES_MAP as orig_slot_ifaces, COLUMN_INTERFACES_MAP as orig_column_ifaces, IMAGE_SIZE_MAP_PER_INTERFACE as orig_size_map, CONFIGLET_INTERFACE_MAP as orig_config_iface_map) from config import SLOT_INTERFACES_MAP, COLUMN_INTERFACES_MAP, \ IMAGE_SIZE_MAP_PER_INTERFACE, CONFIGLET_INTERFACE_MAP orig_slot_ifaces.update(SLOT_INTERFACES_MAP) orig_column_ifaces.update(COLUMN_INTERFACES_MAP) orig_size_map.update(IMAGE_SIZE_MAP_PER_INTERFACE) orig_config_iface_map.update(CONFIGLET_INTERFACE_MAP)