Read the statement by Michael Teeuw here.
Attribution Tag for Default Compliments Model
-
@sdetweil Thanks so much for replying to my post. Just want to confirm that I understand the approach…
So what you are saying is that I should make an .html file and google what html tags to put in it so that I can load it with File…Open in my browser and once it displays correctly, I can take those tags and google how to write javascript code in the getDom function in MagicMirror/modules/default/compliments that will implement those same html tags. Is the correct? Thanks.
-
@raspberrypi9 yes.
you may be able to see how to create html elements in the existing code, but knowing what you want to have will be the most important thing
as you have little experience w this, the html file will be a clean way to gain some of that knowledge.
-
@sdetweil I think I know what I want to do for the visual/presentation aspect. I’m going to just print the attribution name in smaller font at the end of the compliment.
I’d like to change the config schema from:
compliments: {
anytime: [ “compliment 1”,
“compliment 2”]
}to
compliments: {
anytime: [ {“compliment from Bob”, “Bob”},
{“compliment from Lucy”, “Lucy”}]
}but when I just make that change in the config file, it tells me that I have syntax errors. How can I change things so that my new scheme for compliments will be accepted and I can access both the compliment and name field in the compliments.js file where I assume I can modify how it is rendered?
Thanks so much for your help.
-
@raspberrypi9 js objects {} must contain
name: value
pairs
for example{text:"........",author:"mom"}
-
@raspberrypi9 did you figure this out?