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

How do you add alt text to an uploaded asset? #77

Open
darylknight opened this issue Mar 30, 2023 · 0 comments
Open

How do you add alt text to an uploaded asset? #77

darylknight opened this issue Mar 30, 2023 · 0 comments
Labels

Comments

@darylknight
Copy link

Given Craft's big push towards accessibility, hopefully this is already possible or could be implemented. We're working on a guest entries submission form where users submit two images, and each image has a description. These are currently saved as an asset field and a plain text field, but ideally it should attach the description to the asset's native alt field. Is that possible?

<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
	<div class="col-span-1">
		<label for="pupdateImage1" class="block mb-2">Image 1</label>
		<span class="text-gray mb-3 block">
			If you are uploading an image, you must provide a description
		</span>
		<div class="">
			<input type="file" id="pupdateImage1" name="fields[pupdateImage1][]" class="" />
		</div>
		{{ formSubmission ? _self.errorList(formSubmission.getErrors('pupdateImage1')) }}
	</div>
	<div class="col-span-1">
		<label for="fields[pupdateImage1Description]" class="block mb-2">Image 1 Description</label>
		<input type="text"
			name="fields[pupdateImage1Description]"
			id="fields[pupdateImage1Description]"
			class="w-full p-4 border-none" />
		{{ formSubmission ? _self.errorList(formSubmission.getErrors('pupdateImage1Description')) }}
	</div>
</div>
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

1 participant