Read the statement by Michael Teeuw here.
Default Compliments Module - Special Days
-
I wasn’t sure where to put this but I wanted to make use of the “special days” feature of the default compliments and it didn’t behave as I was expecting. I assumed it would override the normally configured compliments and show only the one(s) specific to that day, however it appears to just add the day’s compliments to the existing list.
For example I have this in my config:
"....-12-25": ["Happy Christmas WallysWellies!"]But that message just gets added to my many already configured compliments (I changed the date to test).
For anyone like me that wants to show only this message on your chosen day I tweaked the compliments.js file around line 98 from this:
// Add compliments for special days for (let entry in this.config.compliments) { if (new RegExp(entry).test(date)) { Array.prototype.push.apply(compliments, this.config.compliments[entry]); } }to this:
// Add compliments for special days for (let entry in this.config.compliments) { if (new RegExp(entry).test(date)) { compliments = []; // Empty the array if it's a special day in config.js Array.prototype.push.apply(compliments, this.config.compliments[entry]); } }It just empties the compliments array if it’s a date specified in the config file (or at least I assume that’s how it works - seemed happy in a quick test!).
I didn’t see much info when searching for answers so I thought I might throw it out there for info / discussion.
-
@WallysWellies you should submit that as a bug to the github repo
-
@sdetweil I can do that. I wasn’t sure if it was considered a bug but I’ll log it and see what they say.
-
@WallysWellies said in Default Compliments Module - Special Days:
see what they say.
i help decide too
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login