Caption don't allow HTML code. Am I right?

david-lowdavid-low Registered Users Posts: 754 Major grins

While it is possible to use HTML code for gallery description, it seems HTML code is not recognised for individual picture caption. Is that coorect?

«1

Comments

  • denisegoldbergdenisegoldberg Administrators Posts: 14,383 moderator
    edited June 18, 2018

    @david-low said:
    While it is possible to use HTML code for gallery description, it seems HTML code is not recognised for individual picture caption. Is that coorect?

    What have you tried? I just tried bolding a word and I tried embedding a link in a photo caption using an <a href= statement. Both were successful.

  • david-lowdavid-low Registered Users Posts: 754 Major grins

    Just paragraphing

  • david-lowdavid-low Registered Users Posts: 754 Major grins

    Doesn't work on individual photo. Same code was tested on gallery description and it works

  • AllenAllen Registered Users Posts: 10,013 Major grins
    edited June 18, 2018

    I put in any <p> ... </p> and it saves but it locks the caption and can not edit. Nothing clickable.
    Have to go into tools > Open in Editor > Title, Captions and Keywords to edit.

    Al - Just a volunteer here having fun
    My Website index | My Blog
  • ziggy53ziggy53 Super Moderators Posts: 24,152 moderator
    edited June 18, 2018

    Bold seems OK outside of the Paragraph block.


    PS and non sequitur:

    How big is your cat? (The cat that ate the wolf. )

    ziggy53
    Moderator of the Cameras and Accessories forums
  • AllenAllen Registered Users Posts: 10,013 Major grins
    edited June 18, 2018

    Here's typical HTML I use in captions. Example of one typical caption.

    Hummingbirds: <span style="color:#fff; background:#333;">Allen's Hummingbird</span> <br>
    (Immature male) 
    <br>
    Fenton Missouri <br>
    <a href="/Birds/2008-Birding/Birding-2008-December/2008-12-04-Screech-Owl-Allens/i-8nrDXT5">2008-12-04</a> 
    <br><br>
    
    My 1st Missouri photo, species #222 <br>
    <span style="color:#fff">*** First Missouri Record ***</span> <br>
    2008-11-28 15:06:48<br>
    <div class="noshow">
     See #222 in photo gallery <a href="/Birds/2008-Birding/Birding-2008-November/2008-11-28-Allens-Hummingbird/i-DfQpp69">
    here</a>
    </div>
    
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • JtringJtring Registered Users Posts: 675 Major grins
    edited June 18, 2018

    My standard gallery style is collage landscape. I've observed that some HTML, such as the < a > tag, works in the lightbox but does not work in the smaller collage landscape style caption displays. As Allen notes, some HTML does works in SmugMug gallery style displays. I'm not sure that all HTML is accepted.

    Added note: This one's been around before. See https://dgrin.com/discussion/249671/anchor-tag-in-collage-landscape-gallery/p1

    Jim Ringland . . . . . jtringl.smugmug.com
  • david-lowdavid-low Registered Users Posts: 754 Major grins

    Both screen shots taken fr abv link. One SM hero said can but must upgrade to power ac, yet another said can't. Confused.

  • leftquarkleftquark Registered Users, Retired Mod Posts: 3,784 Many Grins

    I use html in my captions all the time!

    dGrin Afficionado
    Former SmugMug Product Team
    aaron AT aaronmphotography DOT com
    Website: http://www.aaronmphotography.com
    My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
  • Djm3006Djm3006 Registered Users Posts: 226 Major grins
  • david-lowdavid-low Registered Users Posts: 754 Major grins

    So can SM clarify once and for all can or cannot. I hv a pro account and between SM heros each of them said different things.

  • denisegoldbergdenisegoldberg Administrators Posts: 14,383 moderator

    @david-low said:
    So can SM clarify once and for all can or cannot. I hv a pro account and between SM heros each of them said different things.

    It would be helpful to have a list of supported HTML.

    But - from the examples shown in this thread, it appears that paragraphs aren't supported and items like italics, bold, and links are.

  • AllenAllen Registered Users Posts: 10,013 Major grins

    I Just retried paragraphs <p> and it worked this time. ????

    Al - Just a volunteer here having fun
    My Website index | My Blog
  • JtringJtring Registered Users Posts: 675 Major grins

    @leftquark said:
    I use html in my captions all the time!

    In, I observe, SmugMug style galleries.
    The message from McKsauce in 2014, cited above, matches what I'm seeing in 2018.
    (For an example, see the third image in this gallery. There's an anchor tag in the caption. It doesn't show in the Collage Landscape display. It does show in the lightbox.)

    Jim Ringland . . . . . jtringl.smugmug.com
  • david-lowdavid-low Registered Users Posts: 754 Major grins

    I can't cope up with so many variations. Selectively some display style can, while others can't. Then some code can and some code can't. Sigh.

  • Hikin' MikeHikin' Mike Registered Users Posts: 5,467 Major grins

    Just added this to a caption:

    <div class="test-lorem-ipsum">
    
        <p><a href="#">Lorem ipsum dolor sit amet</a>, consectetur adipiscing elit. Aliquam velit est, viverra blandit mollis sed, aliquet nec elit. Quisque fringilla purus non facilisis iaculis. Etiam vel lectus arcu. Nam varius ut enim vitae venenatis. Suspendisse nibh ante, scelerisque eu pellentesque eget, commodo at enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam felis justo, interdum congue odio ac, dapibus euismod elit.</p>
    
        <p>Sed mattis, quam tempus venenatis mattis, nisi eros vulputate ex, eu euismod mauris urna sed ligula. Donec facilisis iaculis mauris sit amet hendrerit. Sed quis bibendum dui, in blandit lorem. Curabitur luctus justo arcu, in interdum nulla egestas eu. Sed suscipit nisl vitae mollis accumsan. Proin suscipit diam et consequat molestie. Pellentesque nec odio commodo, condimentum risus eget, malesuada urna. Vestibulum fermentum pharetra orci. Donec elementum viverra lacus et consequat. Cras sit amet gravida diam. Duis semper diam quam, non pretium tortor imperdiet quis. Curabitur a nulla tellus. Nulla diam libero, tristique vel lacinia eget, molestie ultrices lorem. Donec enim diam, dignissim a faucibus eu, mollis a massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
    
    </div>
    

    Then added some CSS to my theme's CSS:

    .test-lorem-ipsum p {margin:0 auto 25px;}
    .test-lorem-ipsum a {color: yellow;}
    

    Works fine...

  • rjwilnerrjwilner Registered Users Posts: 86 Big grins

    @Hikin' Mike said:
    Just added this to a caption:

    ```

    <

    div class="test-lorem-ipsum">

    May I ask which gallery style you are using. In the 'Collage Landscape' style, I seem unable to make any added html work.

    Interestingly enough, any 'formatting' I enter in the caption is picked up in the Lightbox...w/o any html added.

  • Hikin' MikeHikin' Mike Registered Users Posts: 5,467 Major grins

    @rjwilner said:

    @Hikin' Mike said:
    Just added this to a caption:

    May I ask which gallery style you are using. In the 'Collage Landscape' style, I seem unable to make any added html work.

    Interestingly enough, any 'formatting' I enter in the caption is picked up in the Lightbox...w/o any html added.

    Collage Landscape.

    If you need help, you'll need to post your website/gallery.

  • rjwilnerrjwilner Registered Users Posts: 86 Big grins

    @rjwilner said:

    @Hikin' Mike said:
    Just added this to a caption:

    ```

    <

    div class="test-lorem-ipsum">

    May I ask which gallery style you are using. In the 'Collage Landscape' style, I seem unable to make any added html work.

    Interestingly enough, any 'formatting' I enter in the caption is picked up in the Lightbox...w/o any html added.

    Wow, talk about wildly inconsistent.....
    1) It seems in 'SmugMug Gallery Style' and 'Journal' style, no html formatting is even necessary....for line breaks & paragraphs anyway. For bold, italicize, and href type stuff presumably it is. The caption follows whatever formatting I type in the caption for line breaks & paragraphs.
    2) For the 'Collage' styles (both), adding html code for formatting line breaks just doesn't work at all. Haven't tried yet for href and/or bold/italicize formatting.
    a) And at least for the Collage Landscape style where the 'Info Text' is placed in the Button Bar, there seems to be no means available to even view the entire caption beyond the 2-3 lines of space allotted by the Button Bar. If, for example, I enter a caption something similar to the following, much of the 'image description' piece cannot be viewed.
    Location: Somewhere, USA
    Date Captured: 01/01/01

                                          Some lengthy descriptive info about the image. Some lengthy descriptive info about the image. Some lengthy descriptive info about the image. Some lengthy descriptive info about the image. Some lengthy descriptive info about the image.
    

    With Caption info similar to the above, much of the 'descriptive info' can't be seen in the gallery for Collage Landscape style. It is viewable in the Lightbox, 'but'......

    This is going to take some rethinking.

  • Hikin' MikeHikin' Mike Registered Users Posts: 5,467 Major grins
    edited September 8, 2018

    Just did some testing on my test gallery. I added this to my captions:

    <div class="testing-captions">
    
        <p>This is a caption. Here is a <a href="#">link </a>within a caption.</p>
        <p>This is another paragraph using a &lt;p&gt; tag.</p> This is a <strong>bold text</strong>. This is an <em>italic text</em>.
    
    </div>
    

    I added this to a CSS block:

    .sm-user-ui .testing-captions p {margin:0 auto 25px;}
    .sm-user-ui .testing-captions a {color:red;}
    .sm-user-ui .testing-captions a:hover {color:blue;}
    .sm-user-ui .testing-captions em {font-style: italic;}
    .sm-user-ui .testing-captions strong {font-weight: bold}
    

    This is what I found:
    Thumbnail Gallery, Collage Landscape and Collage Portrait strips HTML/CSS. All other gallery styles retain their HTML/CSS. All gallery styles retain their HTML/CSS in the lightbox.

  • BigRedBigRed Registered Users Posts: 288 Major grins

    RE: HTML in Captions

    @Hikin' Mike said:

    [SNIP]

    This is what I found:
    Thumbnail Gallery, Collage Landscape and Collage Portrait strips HTML/CSS. All other gallery styles retain their HTML/CSS. All gallery styles retain their HTML/CSS in the lightbox.

    Apologies if I missed a more recent thread on this. Does anyone know why this inconsistency exists, and what the plan is for eliminating it? For my particular site, I need tags for italics and links to be rendered correctly in Collage Landscape galleries.

    http://www.janicebrowne.com - Janice Browne Nature Art & Photography
  • leftquarkleftquark Registered Users, Retired Mod Posts: 3,784 Many Grins

    For Collage and Thumbnail galleries: 1-2 lines of the caption aren’t appropriate to have formatting in them when displayed on top of the photo in the “bottom bar”. Captions on top of photos is not a great way to read the caption of the photos and visitors have frequently told us that they both don’t read nor retain the information when it’s displayed there. They do, however, enjoy that it lets them know a caption exists, which they can then read by opening the photo larger (in Lightbox). When the photo is opened in Lightbox, your HTML formatting will be retained and displayed in the caption sidebar.

    For SM and Journal, since the full caption is displayed below the photo, the HTML formatting is retained.

    dGrin Afficionado
    Former SmugMug Product Team
    aaron AT aaronmphotography DOT com
    Website: http://www.aaronmphotography.com
    My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
  • JtringJtring Registered Users Posts: 675 Major grins

    @leftquark said:
    For Collage and Thumbnail galleries: 1-2 lines of the caption aren’t appropriate to have formatting in them when displayed on top of the photo in the “bottom bar”. Captions on top of photos is not a great way to read the caption of the photos and visitors have frequently told us that they both don’t read nor retain the information when it’s displayed there. They do, however, enjoy that it lets them know a caption exists, which they can then read by opening the photo larger (in Lightbox). When the photo is opened in Lightbox, your HTML formatting will be retained and displayed in the caption sidebar.

    For SM and Journal, since the full caption is displayed below the photo, the HTML formatting is retained.

    Gotta push back a little here.

    I think that viewpoint depends on one rather specific vision of how someone will put their site together. Collage galleries allow the caption to be below the photo as well as on top of it. In the collage galleries, images can be large, X-large, or even X2-large. Throw in the two lines for caption text (and another for a title) and there's lots of space down there for information ... and lots of opportunity for creating alternate approaches for interacting with the main gallery display. On my site, I view the main collage view as the primary place to "tell the story". Several captions on the screen at once lets the story be built from the running sequence. One photo can refer to another steps ahead or behind. A viewer can look backwards or forwards easily to make or review connections. That's a different model, of course, from having each image tell its own self-contained story. Neither is model is superior. It depends on how the story teller wants to have at it. SmugMug has provided tools to let folks tell their stories in many different ways -- that's one of SmugMug's great strengths -- and the arguments for turning off HTML are not consistent with some of the options you've opened.

    Jim Ringland . . . . . jtringl.smugmug.com
  • leftquarkleftquark Registered Users, Retired Mod Posts: 3,784 Many Grins
    edited September 18, 2019

    Where would you say we’re inconsitent on the turning off of HTML?

    Views in which the entire caption is displayed, present the caption with HTML included.
    Views in which a snippet of the caption is displayed, parse the HTML out.

    If we’re not doing this somewhere, I’ll be happy to make it function consistently by updating those areas to remove the HTML.

    dGrin Afficionado
    Former SmugMug Product Team
    aaron AT aaronmphotography DOT com
    Website: http://www.aaronmphotography.com
    My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
  • JtringJtring Registered Users Posts: 675 Major grins
    edited September 18, 2019

    Consistency depends on perspective. I think from a developer perspective you've staked out a consistent position, which, in implementation, can present a site viewer with an inconsistent experience. It's quite possible in the collage views with large, X-large, or X2-large images and relatively short captions placed below the image for the site viewer to be presented with complete captions. That's not to say it has to be that way. But that's what a site owner can arrange for a site viewer to see. Now consider the experience of that site viewer. She sees no HTML in the full caption displayed in the collage landscape view, but then in the lightbox sidebar she sees links, bolds, and italics mysteriously appear. She sees an inconsistency. And her experience is more important than yours as developers.

    Jim Ringland . . . . . jtringl.smugmug.com
  • AllenAllen Registered Users Posts: 10,013 Major grins

    If people know HTML and want to use it why are you refusing that option?

    Al - Just a volunteer here having fun
    My Website index | My Blog
  • BigRedBigRed Registered Users Posts: 288 Major grins
    edited September 19, 2019

    I agree with Jim. In addition to putting captions below the images, I'd like to point out another example of how a site owner's implementation choices can exacerbate this inconsistency. We have the option in Settings to entirely turn off captions in the Lightbox (to focus exclusively on the image), so the gallery becomes the sole location for caption info (sometimes length-limited, but not merely a teaser for the Lightbox).

    Caption content can be very format-dependent, and the results of stripping out the HTML can be quite destructive. On my site, for example, words in my captions that are REQUIRED to be italicized (per scientific standards), or that are labels for useful external links, end up presented in a way that makes the captions impossible to read (not only truncated). Looks sloppy and amateurish. So, although I found the Collage Landscape style appropriate in many ways for a few of my galleries, I'm forced to abandon it.

    I can see no justification for SM to "turn off" HTML in Collage gallery style captions. I believe that caption text formatting should always be up to the site owner.

    Seems like this issue is comparable to the recent debate on this forum about the Lightbox design -- the moral of the story being that different purposes are legitimately served by different caption presentations.

    http://www.janicebrowne.com - Janice Browne Nature Art & Photography
  • david-lowdavid-low Registered Users Posts: 754 Major grins

    This post somehow revived while I already took notice more than a yr ago. Lol

  • Paul (France)Paul (France) Registered Users Posts: 30 Big grins

    My galleries are in Collage Portrait and show the complete captions. Yet the HTML is stripped out. I don't understand why, because Leftquark above tells us that HTML will work when entire captions are shown. I need Italic in situations where it is required.

  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins

    Paul,
    Can you include a link to the photo in question? I tested an i and b tag in a caption on my gallery and it's displaying the text formatted fine.

    Sebastian
    SmugMug Support Hero
Sign In or Register to comment.