What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, maybe someone can help us with the following problem -> we try to figure out how the Navi

U01AM1YGRC2
U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet
edited June 2021 in Help

Hello, maybe someone can help us with the following problem ->

we try to figure out how the NavigationWidget should work. We found the following folder in B2B Shop - src/Pyz/Yves/NavigationWidget.

But can’t find the navigation widget in the vendor, so our question is, is that NavigationWidget deprecated ? If yes, why there are these folder already (see in screenshot) 🙂 ?

How I said, it’s just confusing for us, maybe anyone can help us?

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,082 ⚖️ - Guardians (admin)

    Heyhey, have you looked in vendor/spryker-shop/navigation-widget ?
    https://github.com/spryker-shop/navigation-widget

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    I see we don’t own this package in our project, we use the B2B demoshop as initial system

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    It looks like you found the problem ^^

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,082 ⚖️ - Guardians (admin)

    Seems to be not shipped by default (anymore?) - Also the last release for this module was 3 years ago. 😕

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    I see there is a contentNavigationWidget …

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,082 ⚖️ - Guardians (admin)
    edited June 2021

    yes, but namewise it is sth different - also the b2b-demo-shop project level NavigationWidget is referring to the core NavigationWidget

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    Yes and this is not correct and very confusing ^^

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    So how should I call this widget, if I use findWidget(‘ContentNavigationWidget’ [args … ]) the return is null, so that’s not the right way to use it in Twig

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,082 ⚖️ - Guardians (admin)

    I can not follow - Why are we now talking about the ContentNavigationWidget ? Wasnt it NavigationWidget before?

    As example for how to use a widget from the demoshop I found {% widget 'CustomerFullNameWidget' only %}{% endwidget %}

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet
    edited June 2021

    yes that’s right - as far as we can see, Spryker doesn’t use NavigationWidget instead it will use the ContentNavigationWidget:

    I can not follow - Why are we now talking about the ContentNavigationWidget ? Wasnt it NavigationWidget before?

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet
    edited June 2021

    I tried any possibility to use it in twig but couldn’t get it to run 😕 the naming is also weird ^^ ContentNavigationTwigPlugin?

    as you mentioned: the normal call would be: {% widget 'SomeWidgetName' args[] %} but here this won’t work, maybe someone can help us with this? vendor/spryker-shop/content-navigation-widget/src/SprykerShop/Yves/ContentNavigationWidget/Plugin/Twig/ContentNavigationTwigPlugin.php should be called like {% widget 'ContentWidgetTwigPlugin' args['SOCIAL_LINKS', 'navigation-social'] %} or so.

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,082 ⚖️ - Guardians (admin)

    Heyhey,
    if you look into https://github.com/spryker-shop/content-navigation-widget/blob/master/src/SprykerS[…]NavigationWidget/Twig/ContentNavigationTwigFunctionProvider.php you will find the function name.

    if you look for it you will find usages in the cms-import-files, for example: {{ content_navigation('navigation-social-links', 'footer-social-links') }}

    so it does not work as a normal widget but rather as a custom twig function - does this help you?

  • U01AM1YGRC2
    U01AM1YGRC2 Posts: 71 🧑🏻‍🚀 - Cadet

    Thank you Florian, that helps a lot 🙂 and learned something new ^^