0

So there is the twig function sulu_content_load('1234-1234') to get the content via uuid. Is there a way to get to the content of a page via url, like /team/member-1 or /about-us?

owzim
  • 885
  • 2
  • 9
  • 19

1 Answers1

0

there is currently no twig extension for this - but you could write your own and use following services:

  1. "sulu.content.resource_locator.strategy_pool" to get the resourcelocator strategy by your webspace key
$resourceLocatorStrategy = $this->resourceLocatorStrategyPool->getStrategyByWebspaceKey("my-webspace-key");
  1. Get the uuid of the page
$uuid = $resourceLocatorStrategy->loadByResourceLocator("/test-1", "my-webspace-key", "de");
  1. Use "sulu_document_manager.document_manager" to get document of the page
$document = $documentManager->find($uuid, "de");

After this the question is what would you like to do with this document? Do you need some informations out of the content? Or maybe something else?