zomars / bolt-store-hours

An extension to add business hours as a field type within Bolt
3 stars 0 forks source link

Repeating Fields Issue #1

Closed Raistlfiren closed 7 years ago

Raistlfiren commented 8 years ago

If users use this as a repeating field it will not work. (Although, I don't know why you would need to) You should not include JS in the field type as you have done. I would include it in an external script and carry the attributes or options through data attributes. The repeating field uses text/templates and will break any field types with script in them. I would recommend doing something similar to this - https://github.com/Raistlfiren/FAIconFieldType

I would also recommend removing https://github.com/zomars/bolt-store-hours/blob/master/src/StoreHoursExtension.php#L35 so it displays

    /**
     * {@inheritdoc}
     */
    protected function registerTwigPaths()
    {
        return [
            'templates',
        ];
    }
zomars commented 7 years ago

Ok I started reworking on this I still to work on the JS a little more.