Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.0 Neos.Neos:NodeUri relative uris? #4524

Open
mhsdesign opened this issue Sep 17, 2023 · 3 comments
Open

9.0 Neos.Neos:NodeUri relative uris? #4524

mhsdesign opened this issue Sep 17, 2023 · 3 comments

Comments

@mhsdesign
Copy link
Member

what should happen to relative node uris and baseNodeName

public function getBaseNodeName()
{
return $this->fusionValue('baseNodeName');
}

Currently we just removed the whole relative logic, and "baseNodeName" will be unused. :D

And while were at it - baseNodeName was not such a cool idea after all: #2274

@mhsdesign
Copy link
Member Author

Okay i did a little research. Little did i know about neos 8.3 node paths syntax.

Regarding to

public function normalizePath($path, $referencePath = null, $siteNodePath = null)
it seems that its possible to enter following nodepaths in a neos 8.3 Neos.Neos:NodeUri or <neos:uri.node />

not a nodepath but an id will do as well:

  • node://30e893c1-caef-0ca5-b53d-e5699bb8e506

Neos 9 discourages nodepaths and only supports mandatory simple syntax on the cr side.

custom traversal logic or the magic tilde ~ has to be implemented from the outside.

it seems that the view helpers neos:link.node and neos:uri.node have already been adjusted to allow:

  • some/relative/path
  • and special ~/some/site/relativepath

In contrast the Neos.Neos:NodeUri awaits to be implemented:

/** @todo implement us
elseif ($node === '~') {
$nodeAddress = $this->nodeAddressFactory->createFromNode($node);
$nodeAddress = $nodeAddress->withNodeAggregateId(
$this->nodeSiteResolvingService->findSiteNodeForNodeAddress($nodeAddress)->getNodeAggregateId()
);
} elseif (is_string($node) && substr($node, 0, 7) === 'node://') {
$nodeAddress = $this->nodeAddressFactory->createFromNode($node);
$nodeAddress = $nodeAddress->withNodeAggregateId(
NodeAggregateId::fromString(\mb_substr($node, 7))
);*/

The question is which are the desired syntax we want to allow.

Additionally we most likely need to update our documentation.

@kitsunet
Copy link
Member

kitsunet commented Nov 12, 2023

I guess the ~ could be implemented as we can have a contextual knowledge about which site is active here? The rest 🤷 I am fine to axe. 🔥

@mhsdesign
Copy link
Member Author

okay so allow

  • /<Neos.ContentRepository:Root>/my/site
  • some/relative/path
  • ~/about/us will be transformed to /<Neos.Neos:Sites>/mysite/about/us

and that handling should be uniformed for those two viewhelpers and fusion in one place. Maybe Neos\Neos\Utility\LegacyNodePathNormalizer which we will also deprecate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants