Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access custom tokens, it only gives undefined #166

Open
chromaloma opened this issue Apr 21, 2021 · 1 comment
Open

Can't access custom tokens, it only gives undefined #166

chromaloma opened this issue Apr 21, 2021 · 1 comment

Comments

@chromaloma
Copy link

chromaloma commented Apr 21, 2021

Hi! As the title implies, I cannot access the custom tokens in any rss feed, as it only throws back undefined. Are there any known issues here? So if the rss has a field called idtag, wouldn't this be the way to go? (Edit: I simplified the entryTemplate, as this forum apparently shows code with html.)

entryTemplate:'- {idtag}',
limit: 10,
tokens: {
idtag: function(entry, tokens) {
return entry.idtag;
},
}

@ghost
Copy link

ghost commented Mar 3, 2023

I have the same problem.

This does not work:

    tokens: {
      bgColor: function (entry, tokens) {
        return entry['widget-color']['color'];
      },
    },
    tokens: {
      bgColor: function (entry, tokens) {
        return entry.widget-color.color;
      },
    },

This works:

    tokens: {
      bgColor: function (entry, tokens) {
         return "#333333";
      },
    },

Are there any workaround to access custom data from the feed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant