Read the statement by Michael Teeuw here.
how to pull new element added to an array?
-
@justjim1220 said in how to pull new element added to an array?:
this.newsItems
what is that variable?
this.config.feeds is the confiured data -
yeah, I was going by how the rest of the info (title, url, description, etc) is pulled from the feeds array, so thought it would be the same.
-
can u show where newItems is set?
-
start: function () { Log.info("Starting module: " + this.name); // Set locale. moment.locale(config.language); this.newsItems = []; this.loaded = false; this.activeItem = 0; this.scrollPosition = 0; this.registerFeeds(); "use strict"; this.isShowingDescription = this.config.showDescription; },
-
this is the default MM newsfeed, I am trying to modify it to show different things.
-
-
@justjim1220 the problem is that the newsItems array is set from the rest api to pull the entries from the source. THAT data does NOT contain the icon you want to use.
your feed DEFINITION does , but not the feed response data…
so, can u tell from an item which ‘feeds’ entry caused this entry to be in the data? (ie, tell its source)… and can you search the feeds to locate the feed definition from any data in the item?
once u can do that, then u can use the feed entry icon
-
Not quite sure I am following you correctly…
Do you mean to pull the icon from the feeds source? the website? -
ok, so how would I be able to use the corresponding icons/images for the active feed showing if there isn’t any icon data in the rest API?
-
@justjim1220 you have to match up the feed definition (feeds array) with the element in the source response (newsItems array) somehow
the source does not send the icon back