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

Basic Content puts Title as Caption on Images Unexpectedly #37

Open
jeremy-farrance opened this issue Dec 6, 2023 · 0 comments
Open

Comments

@jeremy-farrance
Copy link
Sponsor

jeremy-farrance commented Dec 6, 2023

I'm submitting a

[x] bug report

...about

[x] Razor templating

Current Behavior / Expected Behavior

You can see the problem in the Content App v16.x, bs4/Content/Text and Image.Part-Image.cshtml line 35

 33 <figure class='@(imgItem.Presentation.ImageLightbox != false ? "effect-zoom" : "")'>
 34   @if (Text.Has(pic.Alt)) {
 35     <figcaption class="pt-1 px-4 pb-4 text-white">@pic.Alt</figcaption>
 36   }
 37   @pic
 38 </figure>

Or the bs5 version.

Since on Line 18 in .Picture(), sets imgAltFallback: imgItem.EntityTitle, when you get to line 35 above, the fallback has already set pic.Alt to the title. So you unexpectedly get a caption over the image, repeating the content's Title.

image

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

No branches or pull requests

1 participant