plone / plone/plone.restapi

Urls resolver for Volto

Open
#880 0 comments 0 reactions 3 assignees View on GitHub

@tisto is already working on this.

Since Mar 12, 2020.

04 type: enhancement
Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Description

In Volto right now we have this problem: when we get a content-type with a RichText field with some internal links, restapi returns the html with resolved url (i haven't checked but i think that the serializer calls *.output method).
This leads to have an html with some links that points to the Plone site and not to the Volto site.

Right now i made a change in Volto that removes api url from all links inside returned html..and it works.

Talking with @sneridagh we was thinking if there could be a better (safer) approach to manage this.
Any ideas? I was thinking about an additional parameter for the GET call on a content like "resolve_urls".

By default the api works like now. If you send "resolve_url=False", we could have two possibilites:

  1. restapi returns the html raw (with uids not resolved): this means that Volto needs to do other sequential calls to resolve itself the uids and write correct urls into the html
  2. restapi resolve uids but removes portal_url from links (or print the path without portal id) and then Volto can use links as he wants (if Volto app is in the domain root, he don't need to do anything)

@buchi what do you think about that? Do you had similar issues in your Vue projects? If yes how do you handle them?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.