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..

There currently is no documentation on how to write a CMS Slot Widget right?

UM4BZSK7T
UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet
edited February 2020 in Help

There currently is no documentation on how to write a CMS Slot Widget right? https://documentation.spryker.com/docs/templates-slots-feature-overview#slot-widget So the only chance I have to test this feature is to write a https://github.com/spryker/cms-slot/blob/master/src/Spryker/Client/CmsSlot/Business/CmsSlotDataProvider.php and hope for the best?

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    CMS Slot Widget equals {% cms_slot %} Twig tag. Are you talking about content provider for slot widget?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes. The documentation currently states you have Spryker Blocks and CoreMedia. As we already attached sulu.io by a simple Zed API Controller I am thinking about adding a content provider for a widget. If that has any advantage. Currently we write data in CMS Page Placeholders. THe only real downside is that this is a unique contetn and can't do things like target users.

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    if yes, you need to implement new plugin \SprykerShop\Yves\ShopCmsSlotExtension\Dependency\Plugin\CmsSlotContentPluginInterface and enable it in \Pyz\Yves\ShopCmsSlot\ShopCmsSlotDependencyProvider::getCmsSlotContentPlugins()

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    I asked in the training if this content would be cached by spryker and my latest information is that it will not be cached. But if this is basically a twig function this will end in Redis by the sync and publish Spryker mechanism?

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    content provider plugin will get all provided data from {% cms_slot 'slot-key' with {....} %} inside \Generated\Shared\Transfer\CmsSlotContentRequestTransfer and than you can do everything with this data.

    Eg. return html from Redis, return generated text with Js, return data from external API…

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    we don’t have any training info how to do it. But Spryker Blocks and CoreMedia are already big examples

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    so maybe using Spryker Blocks will be enough for your case.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    No, I believe we then still need to push our content in spryker. Sprykers CMS abilities are so minimal I have no usage for it and the URLs will be provided by sulu as well. So blocks won't be enough.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Okay thanks πŸ™‚ Now I realize that if those slots are fixed inside of a spryker page this will not work as our content managers will never access Zed.