Jump to content

Missing HTML elements in REST output


Recommended Posts

In the output of /cms/records/{database_id}/{record_id} often the whole <a>-Tag ist missing when it's inside a <figure>-Tag:

Original code:

<figure class="image ipsImage_thumbnailed ipsImage" style="float:right">
	<a href="https://xxx.xxx/uploads/monthly_2019_09/XXX-Meldung.PNG.1abaebb2048f2ea1be9a31bf3198e66c.PNG" title="Enlarge image" data-wrappedlink="" data-ipslightbox="" data-ipslightbox-group="undefined">
      <img alt="XXX-Meldung.PNG" data-fileid="11960" data-ratio="19.43" data-unique="hd84ad2uk" height="78" style="" title="" width="400" src="https://xxx.xxx/uploads/monthly_2019_09/XXX-Meldung.PNG.1abaebb2048f2ea1be9a31bf3198e66c.PNG" class="ipsImage_thumbnailed">
  	</a>
	<figcaption>
		Lorem ipsum dolor sit amet
	</figcaption>
</figure>

 

Output REST API:

<figure class=\"image ipsImage_thumbnailed ipsImage\" style=\"float:right\">
  \n\t<img alt=\"XXX-Meldung.PNG\" data-fileid=\"11960\" data-ratio=\"19.43\" data-unique=\"hd84ad2uk\" height=\"78\" style=\"\" title=\"\" width=\"400\" src=\"https:/xxx.xxx/uploads/monthly_2019_09/XXX-Meldung.PNG.1abaebb2048f2ea1be9a31bf3198e66c.PNG\">
  \n\t<figcaption>\n\t\tLorem ipsum dolor sit amet\n\t</figcaption>
  \n</figure>

 

This happens only with these constructs and only in ~35% of them. I can't see a pattern!?

Edited by Koper74
Link to comment
Share on other sites

Hello Koper74, glad to hear you're utilizing the API for your needs. The API for CMS Records actually will return field values exactly as they are stored in the database. To confirm, have a look at record 68 in cms_custom_database_41 and you will see there is no <a> tag wrapping the image.

That <a> tag wrapping the image is added on the front end and is used as the button that blows up the image in a modal view.

Link to comment
Share on other sites

Hello and thank you both - that brought some light in the dark

What is still confusing me:
Our editors adding images in records always the same way via a custom ckeditor-button. The "blow up"-link always get added automatically.


Sometimes like that - which is also stored in database / included in JSON:

<figure class="image ipsImage_thumbnailed ipsImage" style="float:right">
	<a class="ipsAttachLink ipsAttachLink_image" data-fileext="png" data-fileid="12482" href="https://xxx.xx/uploads/monthly_2019_10/1410821622_xxx.png.a2bd3a311d2f687cbafd897f1fb9c51f.png" rel="" data-fullurl="https://xxx.xx/uploads/monthly_2019_10/1410821622_xxx.png.a2bd3a311d2f687cbafd897f1fb9c51f.png" data-ipslightbox="" data-ipslightbox-group="g86105"><img alt="xxx" data-fileid="12482" data-ratio="157.56" data-unique="p3qeq7gap" height="315" style="" title="" width="200" src="https://xxx.xxx/uploads/monthly_2019_10/576538826_xxx.thumb.png.735c9a541dadb92ba62778fa3669a6a7.png" class="ipsImage_thumbnailed"></a>
	<figcaption>
		Abb. 2: xxx
	</figcaption>
</figure>

 

Sometimes like that - here the <a>-Tag is missing in JSON-output:

<figure class="image ipsImage_thumbnailed ipsImage" style="float:right">
	<a href="https://xxx.xx/uploads/monthly_2019_10/1460915268_xxx.png.23f81a1a140efd7cdeb6d454ecdfdda1.png" title="Enlarge image" data-wrappedlink="" data-ipslightbox="" data-ipslightbox-group="undefined"><img alt="xxx" data-fileid="12492" data-ratio="107.14" data-unique="bg9y9kdtf" height="214" width="200" src="https://xxx.xx/uploads/monthly_2019_10/1460915268_xxx.23f81a1a140efd7cdeb6d454ecdfdda1.png" class="ipsImage_thumbnailed"></a>
	<figcaption>
		Abb.&nbsp;3:&nbsp;5-GHz-WLAN-Umgebung
	</figcaption>
</figure>


You can check this at record 110 in cms_custom_database_41:
The 1st and 2nd image is OK and we can "blow it up" in our own application also. The 3rd can only blowup in IPS record view. 

How can we avoid this?

Edited by Koper74
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...