HTML when setting Gallery / Collection and Group Captions

Last post 10-19-2009 23:42 by AF [Zenfolio]. 2 replies.
Page 1 of 1 (3 items)
Next
Previous
Sort Posts:
  • phillips 10-19-2009 20:50

    • Top 150 Contributor
    • Joined on 03-14-2008
    • Posts: 23

    HTML when setting Gallery / Collection and Group Captions

    Hello,

    Couple of questions here relating to links (and HTML in general) in the caption field where available.

    I notice that, via the web UI, links are possible using the rich text editing box but it appears that one does not have complete control over what is essentially the construction of the <a> tag.

    As far as I can tell, the href conents and what's within the tag have to be the same, for example...

    <a href="www.xyz.com">www.xyz.com</a>

    ...the following does not appear to be possible...

    <a href="www.xyz.com">click here</a>

    I was hoping I could resolve this using the API, but when I try and pass something like the second example in, I get an error.

    First, is it even possible to have an <a> tag like the second example and, if so, is there a particular encoding I have to use in order to pass it into the API.

    When I try using the API and get a LoadPhotoSetResult returned, the <Caption> tag contains the following...

    <Caption>A &lt;a href="http://www.somesite.com" target="_self"&gt;http:/​/​www.​somesite.​com&lt;/a&gt; link</Caption>

    Am wondering whether I need to use a particular character encoding when sending SOAP requests (I'm using UTF-8) or use special escape sequences within the caption itself in order to get the HTML in there.

    It would be nice to be able to add HTML to captions using the API (as opposed to using the web UI's rich text box).

    Thanks,

    Matthew

  • phillips 10-19-2009 21:01 In reply to

    • Top 150 Contributor
    • Joined on 03-14-2008
    • Posts: 23

    Re: HTML when setting Gallery / Collection and Group Captions

    Looks like I might have figured this out, seems that '<' and '>' need to be escaped with &lt; and &gt; respectively (presumably so that the HTML does get confused with the XML being sent over)

  • AF [Zenfolio] 10-19-2009 23:42 In reply to

    • Top 10 Contributor
    • Joined on 03-01-2008
    • San Francisco Bay Area, California
    • Posts: 583

    Re: HTML when setting Gallery / Collection and Group Captions

    phillips:

    As far as I can tell, the href conents and what's within the tag have to be the same, for example...

    <a href="www.xyz.com">www.xyz.com</a>

    ...the following does not appear to be possible...

    <a href="www.xyz.com">click here</a>

    You can turn any text into a link using the UI. Just highlight the text and click the Link button.

     

    phillips:
    Am wondering whether I need to use a particular character encoding when sending SOAP requests (I'm using UTF-8) or use special escape sequences within the caption itself in order to get the HTML in there.

    All API strings are in UTF-8. The Caption field accepts a limited set of HTML tags: <a>, <strong>, <em>, <u>, <span class="small">, <span class="medium">, <span class="large">, <ol>, <ul>, and <li>.

    HTML tags need to be HTML-encoded when sent as part of a SOAP message.

    -- AF [Zenfolio]
Page 1 of 1 (3 items)