Missing images in portal_factory
With a theme or other Plone 3+ product with a browser directory, resources such as images are called using ++resource++my.theme.images/image-name.png. But when you are creating a new bit of content e.g. a new web page, the portal_factory doesn't render these properly and gives an error:
BadRequest: The id "++resource++bb.networks.images" contains characters illegal in URLs.
This litters up the log and the missing images don't look that good for our clients when they come to create content. The way round it is to include the full URL of the image in the src attribute of the image. This involves adding a tal:attributes call to the image tag in the template as follows:
This only needs to be done for macros or code used in portlets and viewlets which will then be displayed with the portal_factory template i.e. header and footer and left and right column content. It does not need to be added to templates that are displayed as part of the main content, as these will be replaced by the portal_factory templates.