Placeholder for nested objects (questions, images) in articles

Hi,

I want to include questions, images and other objects in articles.
I know the common way to add images and questions to an article is the attachment property.
Depending on the client implementation this would show all the attachments at the end of the article.
But I want them on defined positions in the article. Is there a common placeholder for this?

I wrote this example article object, where I want the image displayed instead of <attachment attachment_id="1"/> and the question instead of <attachment attachment_id="2"/>. It would be easy to implement this in my own client, but I want interoperability with other clients. So is there a common tag or other attribute to define where an attachment should be shown?

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Article",
  "id": "https://example.com/bob/posts/cd92732f3ac229d7",
  "attributedTo": "https://example.com/persons/bob",
  "name": "Example Post" 
  "content": "<p>This is an example.</p><attachment attachment_id=\"1\"/><p>Here is more text followed by a question.</p><attachment attachment_id=\"2\"/><p>After the question is even more text.</p>", 
  "attachment": [
    {
      "type": "Image",
      "content": "This is an eyample image",
      "url": "http://example.org/cat.jpeg"
    }, 
    {
      "type": "Question",
      "id": "http://example.com/questions/25",
      "name": "What is the answer?",
      "oneOf": [
        {"name": "Option 1"},
        {"name": "Option 2"}
      ]
    }
  ]
}

Well,
the problem is that there is no convention with it …
It was a frequently asked question about how to represent ActivityPub in HTML at all (without an answer).

But @redaktor.me would like to have it as well.
To point to the attachment (or any other property) one could use JSON pointer rfc6901

Hey @wobber and @Sebastian,
Did anything change since this exchange? I am also curious about how to represent nested “objects” especially on longer posts like Articles and Pages.

Another direction for this question is: Do I HAVE TO add all the resources used in an HTML content? For example: If my content links to a publicly available image URL, is there any advantage to add it as an attachment as well?

I think FEP-e232 is a good way to represent nested objects that are referenced in HTML content. In this proposal we use the tag property, which is also used to represent hashtags, mentions and custom emojis.

If a link to object is not present in HTML content, I would use the attachment property.

1 Like

That is exactly what I was looking for, @silverpill!
Also good to see that some relevant player are implementing it.
Thanks.

1 Like