user966660
user966660

Reputation: 592

Reuse mockup-pattern for anonymous theme

I want to reuse momentjs (mockup-patterns-moment) in the frontend theme, but it does not work

What I already tried:

require([
    'example.theme',
    'mockup-patterns-moment'
]);

in Ressource-registry, or direct in theme .html nothing worked for me...

Upvotes: 1

Views: 123

Answers (2)

vangheem
vangheem

Reputation: 3293

In your theme html file, you should be able to do something like this

<script>
    require([
        'mockup-patterns-moment'
    ]);
</script>

Then do, as @ebrehault suggests

<span class="pat-moment"
     data-pat-moment="format:calendar">2016-06-16</span>

See the answer here: https://community.plone.org/t/how-to-make-pat-moment-available-to-anonymous-users/1577

Upvotes: 0

ebrehault
ebrehault

Reputation: 2601

This pattern is already part of the Plone default bundle, so you do not have anything to declare to use it, just use the proper markup:

<span class="pat-moment"
     data-pat-moment="format:calendar">2016-06-16</span>

Upvotes: 1

Related Questions