Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.2.0, 4.3.0, 4.4.0alpha1
-
None
-
Operating System: Ubuntu 9.10
PHP Version: (please be specific, like '4.4.3' or '5.1.5'): 5.3
Database and version: MySQL 5
Browser (and version): FireFox 3.6.3
Description
I have customized my extension/ezoe/settings/content.ini.append.php to allow custom CSS classes to be added to links:
[link] ... AvailableClasses[]=issuu AvailableClasses[]=slideshow
After this, I'm able to set the classes "issuu" and "slideshow" to the text links in the WYSIWYG editor for the content.
And this works when the link is text link.
However, when I insert an image and make it link and select the link class to be "slideshow" for example, the CSS class doesn't go to the link attributes.
I've checked which template renders the image within the link that I've set as "slideshow". I found that actually there are 3 templates for rendering an embedded image. Here are the used templates:
design/standard/templates/content/datatype/view/ezxmltags/embed.tpl extension/ezwebin/design/ezwebin/override/templates/embed/image.tpl xtension/ezwebin/design/ezwebin/templates/content/datatype/view/ezimage.tpl
In the first one - embed.tpl - there is a variable $link_parameters which has a property class that contains the right CSS class I've set - "slideshow".
In the second template - image.tpl - there is also a variable $link_parameters which holds the proper CSS class name.
However in the third template - ezimage.tpl - there is no $link_parameters variable. There are two other variables - $link_class and $css_class that I thought might contain data abouth the CSS class "slideshow", but no luck
The problem is that in the second template:
extension/ezwebin/design/ezwebin/override/templates/embed/image.tpl
the link class parameter was not passed to the third template:
extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezimage.tpl
within the
{attribute_view_gui ...}statement.
And it was expected in the third template as a variable $link_class.
So, it needs to passed in the second template:
{attribute_view_gui ... link_class=$link_parameters.class ... }
Steps to reproduce
1. Customize extension/ezoe/settings/content.ini.append.php to allow custom CSS classes to be added to links:
[link] ... AvailableClasses[]=issuu AvailableClasses[]=slideshow
2. Create some content and via the WYSIWYG editor create a link with image inside, instead of text and choose one of the custom CSS classes like "slideshow" or "issuu".
3. Publish the content and check if the "slideshow" (or "issuu") are applied in the link wrapping the image.