WebEngine icon indicating copy to clipboard operation
WebEngine copied to clipboard

Dynamic pages: add class to body for each dynamic path part

Open g105b opened this issue 2 years ago • 1 comments

For example, on URL /shop/computers/apple/macbook-pro

There can be multiple dynamic path parts: page/shop/@shop-area/@brand/@item.html

Currently, the body gets the following classes:

  • dir--page
  • dir--page--shop
  • dir--page--shop--_shop-area
  • dir--page--shop--_shop-area--_brand
  • dir--page--shop--_shop-area--_brand--_item
  • uri--page--shop--_shop-area--_brand--_item

It would also be good to see the following classes, or something similar, so the individual dynamic pages can be referenced in CSS where appropriate:

  • _shop-area--computers
  • _brand--apple
  • _item--macbook-pro

g105b avatar Oct 16 '23 09:10 g105b

Can be implemented here: https://github.com/PhpGt/WebEngine/blob/64daaae7a9f6dec9f9935006c2ae930d76e0097a/src/Middleware/RequestHandler.php#L202-L213

g105b avatar Nov 01 '23 13:11 g105b