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

[4.0] fields accessibility #27571

Closed
brianteeman opened this issue Jan 19, 2020 · 19 comments
Closed

[4.0] fields accessibility #27571

brianteeman opened this issue Jan 19, 2020 · 19 comments
Labels

Comments

@brianteeman
Copy link
Contributor

This is to aggregate two separate issues that have the same base

1. Image field

This field needs the ability to set an ALT attribute. This is essential for accessibility

2. Url field

This field needs the ability to set the value to be displayed for the link. For example it would be better to display a url as joomla news than https://www.joomla.org/announcements/release-news/5781-joomla-3-9-14.html

@Bakual
Copy link
Contributor

Bakual commented Jan 19, 2020

We could specify additional parameters (like "alt" or "display value" when creating the field. That would be the same in each item (eg article) where that field appears.
But I don't think that is what you want?

If you expect the user who fills the value for the field to also specify the ALT text or the display value, then that will not be possible. Simply because you expect one field to generate two fields (eg src and alt for the image). You'd have to create two fields for that and use them properly in your override, which is already possible today.

@chmst
Copy link
Contributor

chmst commented Jan 19, 2020

I fond this issue two years ago, but als @Bakual says, it is not possible without changing the database and the whole output of the fields.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27571.

@brianteeman
Copy link
Contributor Author

You can say it's not possible but it must be fixed or everything said about accessibility with j4 is invalid

@Bakual
Copy link
Contributor

Bakual commented Jan 20, 2020

You would have to change the whole architecture of com_fields to allow that. And by doing that, you will break the fields as the whole code is meant to process a single input per field. I'd be strongly against that.

Those are custom fields. This has nothing to do with our accessibility promise for J4. It's user generated content and thus out of our control.

If you need a field for the ALT attribute, nothing stops you from creating that field to accompany the image field (which is in fact just an file selector field). You just need to set up everything you need yourself, it's not done automatically.

@Fedik
Copy link
Member

Fedik commented Jan 20, 2020

or store value as JSON {"src":"blabla/path/to-image.jpg", "alt":"random text"}
but that also not best and easy :)

@brianteeman
Copy link
Contributor Author

For the URL field I have already written the code

@laoneo
Copy link
Member

laoneo commented Jan 21, 2020

@Fedik having it as json makes it harder to index and search.

@brianteeman
Copy link
Contributor Author

  1. its an image so I doubt we would ever have indexed it
  2. subfields are already stored as json

@Fedik
Copy link
Member

Fedik commented Jan 21, 2020

@laoneo no, not really make a difference, the finder doing indexing of the "final render", will be indexed what is rendered 😉

@laoneo
Copy link
Member

laoneo commented Jan 21, 2020

Are you sure? Anyway, simething tells me that we will run into some issues. But on the otherside it would be nice to have a display value. Un general it would be cool if we can break up fields that way.

@Fedik
Copy link
Member

Fedik commented Jan 21, 2020

@laoneo check the finder plugin onContentAfterSave and index(), it uses the same onContentPrepare stuff, so if the field are rendered at onContentPrepare then it will be indexed with the article text.

Anyway, simething tells me that we will run into some issues

I did not said that it is a perfect solution, just an idea

@astridx
Copy link
Contributor

astridx commented Jan 21, 2020

@brianteeman For the URL field I have already written the code

Did you create a PR for this?

@astridx
Copy link
Contributor

astridx commented Jan 21, 2020

For the media field: At the moment it is the case that no alt-tag for the media field is output in the markup.
Perhaps we could insert a text field in the custom field in which an alt-text can be inserted for all images for this Custom Fields together.

Articles  Edit Field   Test   Administration

In my opinion it is usually the case that the pictures explain a certain aspect. So it is possible to formulate the text so, that is fits.

Of course, it's not that it's the best solution for adding an alt tag. But it is a compromise.In any case, the formal criteria are met.

@brianteeman
Copy link
Contributor Author

@astridx I submitted the PR for the url field yesterday #27597

@astridx
Copy link
Contributor

astridx commented Jan 23, 2020

What do you think of it when we generate the alt text from the file name? For example, an image file with the name Aerial_view_of_Central_Park_in_New_York.jpg receives the alt text Aerial view of Central Park in New York.

@brianteeman
Copy link
Contributor Author

@astridx that is not a solution. we can and must do better than that

@astridx
Copy link
Contributor

astridx commented Jan 23, 2020

The layout and the field are used in several places.

If you insert a text field here, this will also be shown when creating an article.
When creating an article, there is already a text field in which an alternative text can be entered.
Articles  Edit   test   Administration

Shall we create a new field (that inherits from the media field) and layout for the custom field?

@brianteeman
Copy link
Contributor Author

However it is done when a user adds an image field it should include an ALT attribute input. It cannot be something they have to add as a separate field

@brianteeman
Copy link
Contributor Author

closed as we now have a good draft pr for the media field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants