Page attachment links prefix

Since a while now, it’s possible to choose between the document (wiki:Space1.Space2.Document) or the page (wiki:Space1/Space2) reference syntax when linking a page.

While it’s possible to link an attachment using the document reference syntax it’s not possible to do the same with the page reference syntax. The syntax does exist already, but there is no entry point to use it in the link syntax.

So we need to decide of a prefix to use for page attachments, like we have the prefix attach for document attachments.

And as usual naming is the hard part and I honestly don’t have a perfect proposal so here are some ideas:

  1. page_attachment (consistent with EntityType.PAGE_ATTACHEMENT)
  2. page_attach (kind of a mix of being consistent with both attach which leads to EntityType.ATTACHMENT and EntityType.PAGE_ATTACHMENT)
  3. pageAttachment (same logic as 1 but camel case version)
  4. pageAttach (same logic as 2 but camel case version)
  5. pattach (short and closer to attach but a bit weird)

Other brilliant ideas ?

Since the syntax is likely to be seen as such more often in a wiki syntax context than as a Java one (in Java, only references to EntityType.PAGE_ATTACHEMENT are likely to be used, not the string declaration itself), I have a slight preference for pageAttach since we use more camel case than snake case in wiki syntax eg for wiki macro names, parameters or options. HTH.

So for me the most logical is (we don’t use any _ in link prefixes and the other parts of the syntax use camel case for query string and others):

  • Doc linking using a document reference style: [[doc:wiki:Space1.Space2.Page]] (or [[wiki:Space1.Space2.Page]]).
  • Attachment linking using a document reference style: [[attach:wiki:Space1.Space2.Page]].
  • Doc linking using a page reference style: [[page:wiki:Space1/Space2/Page]].
  • Attachment linking using a page reference style: [[pageAttach:wiki:Space1.Space2.Page]].

Note: It’s starting to be a bit complex for wiki users with all the various notations…

@tmortagne I couldn’t find a reference to the page link prefix in the syntax documentation, did you forget to add it?

That’s not the page reference style or an attachment :slight_smile:

I did actually according to XWIKI-15746: Document the new Page syntax In XWikiSyntax · xwiki/xwiki-platform@3318702 · GitHub but indeed seems outdated.

But looks ok on so not sure how the one you referenced is supposed to be kept up to date.

The content of that page was using {{display reference="platform:XWiki.XWikiSyntax"/}}. The platform wiki is now gone, so I’ve pointed to the main wiki now. Looks good. Thanks

BTW note that this will be a backward-compatibility breakage for XWiki Syntax 2.1 if we introduce it for it…

Any existing link to a subwiki named pageAttach (or any of the other proposed names) and not using the explicit doc link prefix will be broken.

It seems that pageAttach is a clear winner, so let’s go with that. Works started on Loading....