Hello guys,
i have a small problem. I created a plugin and i want to optimize the routing.
The plugin uses entities instead of nodes. So i use the routeParts section with objectType (http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/Routing.html).
Using the route with identifier is working.
My workflow:
- Updated route with routeParts
- Added @Flow\Identity in my entity with property title
- Generated migrations (Added a new unique index to the property title)
- Migrated the new migration
Here are the snippets
- name: 'Kunde.MainWebsite Calculator By Product' uriPattern: '{node}/produkt/{product}.html' defaults: '@package': 'TYPO3.Neos' '@controller': 'Frontend\Node' '@format': 'html' '@action': 'show' '--kunde_mainwebsite-calculator': '@package': 'Kunde.MainWebsite' '@subpackage': '' '@controller': 'Frontend\Product' '@action': 'calculator' routeParts: node: handler: TYPO3\Neos\Routing\FrontendNodeRoutePartHandler product: objectType: 'Kunde\MainWebsite\Domain\Model\Product' appendExceedingArguments: TRUE
`/**
-
An product
-
@Flow\Entity
*/
class Product {/**
- Title
- @var string
- @Flow\Identity
- @Flow\Validate(type=“NotEmpty”)
- @Flow\Validate(type=“StringLength”, options={ “minimum”=1, “maximum”=80 })
-
@ORM\Column(length=80)
*/
protected $title;
…`
I have a title like “Strom BASIS”, so i tried the url “{my-node}/produkt/strom-basis.html”. But i get the error “Page not found. Missing controller”.
{my-node} is the page, wehere i added the plugin.
Thanks in advance for your help
Greets Rene
Addition: With uriPattern in the Routes.yaml it is working correctly.
With @Flow\Identity its is not working.