Skip to content

Commit

Permalink
Change slug generatorOptions.fields examples (#868)
Browse files Browse the repository at this point in the history
Reuse the same examples from the changelog with
the following changes:

- For nav_title, title instead of concatenate we use
  "or" (use nav_title if not empty, else use title)
  This makes more sense in a realworld example.
- In the second columns, set only the values for the
  fields which are used in the first column
- For the example of array of strings, add the
  notation for array as array as well (example 3)

---------

Co-authored-by: Chris Müller <[email protected]>
  • Loading branch information
sypets and brotkrueml authored Nov 18, 2023
1 parent 62a5b31 commit fecf70f
Showing 1 changed file with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ generatorOptions

Examples:

+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
| Configuration value | Values of an example page record | Resulting slug |
+===========================================================+======================================================================================================================================+============================================+
|:php:`['nav_title', 'title']` | :php:`['title' => 'Products', 'nav_title' => '', 'subtitle' => '']` | `/products` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
|:php:`['nav_title', 'title']` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => '']` | `/best-products/products` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
|:php:`[['nav_title', 'title']]` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => '']` | `/best-products` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
|:php:`['subtitle', 'nav_title', 'title']` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => 'Product subtitle']` | `/product-subtitle/best-products/products` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
|:php:`[['nav_title', 'title'], 'subtitle']` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => 'Product subtitle']` | `/best-products/product-subtitle` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
|:php:`[['seo_title', 'title'], ['nav_title', 'subtitle']]` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => 'Product subtitle', 'seo_title' => 'SEO product title']` | `/seo-product-title/best-products` |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------+
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+
| Configuration value | Values of an example page record | Resulting slug |
+=================================================================+======================================================================================================================================+===================================+
|:php:`[['nav_title', 'title']]` | :php:`['title' => 'Products', 'nav_title' => '']` | `/products` |
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+
|:php:`[['title', 'subtitle']]` | :php:`['title' => 'Products', 'subtitle' => 'Product subtitle']` | `/products` |
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+
|:php:`['title', 'subtitle']` or :php:`[['title'], ['subtitle']]` | :php:`['title' => 'Products', 'subtitle' => 'Product subtitle']` | `/products/product-subtitle` |
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+
|:php:`['nav_title', 'title'], 'subtitle'` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => 'Product subtitle']` | `/best-products/product-subtitle` |
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+
|:php:`['seo_title', 'title'], ['nav_title', 'subtitle']` | :php:`['title' => 'Products', 'nav_title' => 'Best products', 'subtitle' => 'Product subtitle', 'seo_title' => 'SEO product title']` | `/seo-product-title/best-products`|
+-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+


.. confval:: generatorOptions:fieldSeparator
Expand Down

0 comments on commit fecf70f

Please sign in to comment.