Joomla CCK Seblod: Adding a Media field with 'alt' and 'title' attribute

1k views Asked by At

I am working with Joomla 2.5.16 and use the CCK extension SEBLOD (3.1.5). I have created a content type with an admin form and added the fields to the content. My form includes four images, which are of the build-in type Media.

When I create a new article of my content type, then I select the four images from the media manager and they appear at the correct position of the seb_one template. However I also get the following error:

Notice: Undefined property: stdClass::$image_title in 
    /var/www/../plugins/cck_field_typo/image/image.php on line 70
Notice: Undefined property: stdClass::$image_alt in 
    /var/www/../plugins/cck_field_typo/image/image.php on line 71

In the referenced file there is the following code:

$img_title          =   $field->image_title;
$img_description    =   $field->image_alt;

When I dump the $field variable I can see that there are no fields named ["image_title"] and ["image_alt"]. I have commented out the respective lines for now in the plugin, but I would prefer to find a solution where I can let the user choose an image title and alt description.

If I understand this correctly by default there is no way to enter these fields through the media manager. When I insert an image in a regular article, then I have to the the alt attribute through the WYSIWYG editor. Similarly I am guessing, that there has to be some way to configure SEBLOD such that I can ask the user for an image title and alt description.

Here is how I have configured the Field in Seblod: enter image description here

Under typography I have selected Image

Here is how the field looks like when I create a new article of my content type: enter image description here

If I click on select there is no field to set the title or alt description: enter image description here

On the other hand, when I edit a default article type and I click on "Add Image" then the same modal window for choosing an image opens, but it has fields to enter the title and alt description: enter image description here

My question is, what options exist to connect the title and alt attributes for the image using SEBLOD. Is this a configuration problem or a bug in SEBLOD?

1

There are 1 answers

0
James On BEST ANSWER

The latest version of SEBLOD fixes the error message that you get, however, the JFormMedia field in SEBLOD does not currently manage the title and description attached to images. Instead, for that you can use the SEBLOD Image Upload field which allows you to attach a title and a description to an image.