Add functionality to generate menu data

Created on 2 April 2025, 5 days ago

Add a twig extention that will generate dummy menu data.

There needs to be some control over the shape of the generated menu tree, for instance tree depth, width and varience. Make sure that the data generated matches the format of the menu data generated by Drupal so that it can be used as a swap in replacement.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom daniel.j

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @daniel.j
  • Pipeline finished with Success
    4 days ago
    #463418
  • Pipeline finished with Success
    4 days ago
    #463443
  • Pipeline finished with Success
    4 days ago
    #463455
  • Pipeline finished with Success
    4 days ago
    #463465
  • Pipeline finished with Canceled
    4 days ago
    #463490
  • Pipeline finished with Success
    4 days ago
    #463491
  • Pipeline finished with Success
    4 days ago
    #463503
  • Pipeline finished with Canceled
    4 days ago
    #463519
  • Pipeline finished with Canceled
    4 days ago
    #463523
  • Pipeline finished with Canceled
    4 days ago
    #463528
  • Pipeline finished with Success
    4 days ago
    #463531
  • Tested patch locally and tp_menu_data() worked for me.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    darren.fisher β†’ made their first commit to this issue’s fork.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    This is looking really good. I've updated the README in this branch to document this new functionality and changed the default values in MenuDataExtension.php to match what is in the README.

    Next steps:

    1. I'm going to look at using the lorem ipsum service to generate the menu titles.
    2. We'll want some tests similar to the other twig functions that cover the functionality provided by this new twig function.
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Added the lorem ipsum service to this. Something I've realised is that the lorem ipsum service assumes you want sentences and add full stops to the end of each generation so I will open a separate issue to deal with this and later implement it here.

  • Pipeline finished with Failed
    3 days ago
    Total: 144s
    #464690
  • Pipeline finished with Failed
    3 days ago
    Total: 142s
    #464691
  • Pipeline finished with Success
    3 days ago
    Total: 182s
    #464710
  • πŸ‡¬πŸ‡§United Kingdom daniel.j

    I've added `MenuDataExtensionTest` to add coverage for this functionality.

    Otherwise, I think that this is ready to go, unless it would be good to add another way to specify the shape / size of the menu data other than just the array shape that is implemented already?

    Also, would it be good to include any other keys in the menu array, or is the super basic "title", "URL", "attributes" and "below" good enough?

  • Pipeline finished with Success
    3 days ago
    Total: 268s
    #464719
  • Pipeline finished with Success
    3 days ago
    Total: 145s
    #464726
  • Pipeline finished with Success
    3 days ago
    Total: 168s
    #464739
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    This looks good. Going to merge to dev and then fix the pipeline there as it's a bit easier for my workflow. I like the way the arguments work so happy to merge in as is.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Thanks for testing the MR @priscarabelli!!

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Marking fixed. Will tag a release once the tests are passing on 1.0.x

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Tagged and released. Thanks everyone.

Production build 0.71.5 2024