FANDOM


  • Is it possible to do two captions under an infobox image? I tried this:

    
    <image source="image">
    
    <caption source="caption"></caption> 
    
    <caption source="image_src">
    
    <format>image [[{{{image_src}}}|src]]</format>
    
    </caption>  
    
    </image>
    
    

    and that didn't work.



    I need a "caption" field and I also need an "image source" field so viewers can know which episode the image came from, but I don't want to give up my "caption" field.

      Loading editor
    • How about something like this?

      <image source="image">
      <caption source="caption">
      <default>{{#if: {{{image_src|}}} | image [[{{{image_src}}}|src]]}}</default>
      <format>{{{caption}}}<br />{{#if: {{{image_src|}}} | image [[{{{image_src}}}|src]]}}</format>
      </caption> 
      </image>
      
        Loading editor
    • Okay, that helps, but how do I add a line break after "caption" since <br> is not supported.

        Loading editor
    • try
      <span style="clear:both">{{{caption}}}</span>
      not so good solution, but u can invent something more reliable.
        Loading editor
    • <br> is not supported in the caption?

      Maybe wrap {{{caption}}} in <div></div>? HTML usually puts linebreaks after divs.

        Loading editor
    • Thanks for trying both of you, but none of these solutions are working. Portable infoboxes just ignore these tags.

        Loading editor
    • then, change image tag to data.

        Loading editor
    • That helped, actually I changed the "image_src" tag from <caption> to <data> and now I have this:

      <image source="image">
      <caption source="caption">
      </caption> 
      </image>
       <data source="image_src">
      <format><div style="color: #757575;">image src: [{{{image_src}}}]</div></format>
      </data>
      

      But one last thing, I want the image_src data to come before the caption, so I ended up with this:

      <image source="image">
           <data source="image_src">
      <format><div style="color: #757575;">image src: [{{{image_src}}}]</div></format>
      </data>
      <caption source="caption">
      </caption> 
      </image>
      

      And that doesn't work.

        Loading editor
    • That is interesting the PI ignores HTML. Yes, unfortunately, you cannot just place tags wherever you want. The image tag does not accept the data tag as a child. What about swapping the roles of the caption and data tag. Use the caption with imge_src and the data tag with caption?

        Loading editor
    • Never thought of that, thanks.

        Loading editor
    • PI doesn't ignore HTML, it just selectively accepts it. Usually if you use <format></format>, it accepts most HTML, but I forgot to mention it earlier. Not sure if it works inside caption tags, though.

        Loading editor
    • Well, the br tag seems to work inside the default tag; so I would have thought it would work in the format tag as well.

        Loading editor
    • it's image tag. it have all rights to ignore any data that not an image. so this behavior is something non-unexpected.

        Loading editor
    • Fngplg wrote: it's image tag. it have all rights to ignore any data that not an image. so this behavior is something non-unexpected.

      True.

        Loading editor
    • In case you didn't know it was there: Help:Infoboxes/Tags

        Loading editor
    • Fngplg wrote:

      it's image tag. it have all rights to ignore any data that not an image. so this behavior is something non-unexpected.

      ...and not caption.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.