OFFLINE-GmbH / oc-opening-hours-plugin

:clock3: Manage and display opening hours on your website
MIT License
4 stars 7 forks source link

How to override template of snippet? #7

Open elceka opened 4 years ago

elceka commented 4 years ago

Hi, please, how i can override snippet template? I know, snippet template is same as the component template, overriding template is working for component (in the theme partials folder) but it is not working for snippet, snippet still use not overriding template of the plugin. I think, this is not a issue of your's plugin, but maybe you can me help with it... Thank you.

elceka commented 4 years ago

OK, I have it. We can use plugin component in our snippet created from partial view. Bud in the template file default.html is a bug, because shows only all opening hours. If you have selected slug of one opening hour location it doesn't matter.

Sample code of snippet created from partial view:

[viewBag]
snippetCode = "exam-times"
snippetName = "Exam times"
snippetProperties[slug][title] = "Code of exam times"
snippetProperties[slug][type] = "string"
snippetProperties[slug][default] = ""
snippetProperties[slug][options][] = ""

[openingHours]
slug = "{{slug}}"
==
{% component 'openingHours' %}
tobias-kuendig commented 4 years ago

Bud in the template file default.html is a bug, because shows only all opening hours. If you have selected slug of one opening hour location it doesn't matter.

Sorry, I don't understand this error description. What does work and what doesn't?