.@cowboysdude was exceptionally helpful last night.
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-MealViewer
So I now get the following table:
Elementary Lunch
Entree “Bold” Cheese Pizza
Entree “Bold” Pepperoni Pizza
Vegetable Parmesan Butternut Gratin
Vegetable Seasoned Green Beans
Elementary Alternative
Entree Chef Salad
Entree Bologna & Cheese SandwichThe foodItemType in the first column and the foodItemName in the second column are siblings in the data array.
I’d like turn the first occurrence of foodItemType into a category so the table looks like this (ignore the spacing hyphens):
Elementary Lunch
Entree “Bold” Cheese Pizza
--------------“Bold” Pepperoni Pizza
Vegetable Parmesan Butternut Gratin
-------------------Seasoned Green Beans
Elementary Alternative
Entree Chef Salad
-------------Bologna & Cheese SandwichHere’s the current loop that creates the table. Any help would be appreciated.
// Iterate through the cafeteria lines for the school for (var j = 0; j < this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data.length; j++) { if (this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].name !== 'Elmwood Vegetarian Hot Entree') { // Set up header row with the cafeteria line name cafeteriaLineRow = document.createElement("tr"); cafeteriaLineName = document.createElement("td"); cafeteriaLineName.innerHTML = this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].name.replace("Elmwood Elementary", "Elementary Lunch").replace("Elmwood Alternative", "Elementary Alternative"); cafeteriaLineRow.appendChild(cafeteriaLineName); wrapper.appendChild(cafeteriaLineRow); // Iterate through the menu items for the cafeteria line for (var k = 0; k < this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].foodItemList.data.length; k++) { if (this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].foodItemList.data[k].item_Name !== 'Choice Of:') { foodItemTypeRow = documen t.createElement("tr"); foodItemType = document.createElement("td"); foodItemType.innerHTML = this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].foodItemList.data[k].item_Type; foodItemName = document.createElement("td"); foodItemName.innerHTML = this.results[i].menuSchedules[0].menuBlocks[0].cafeteriaLineList.data[j].foodItemList.data[k].item_Name; foodItemTypeRow.appendChild(foodItemType); wrapper.appendChild(foodItemTypeRow); foodItemTypeRow.appendChild(foodItemName); wrapper.appendChild(foodItemTypeRow); } } } }
-
RE: Conditional formatting of config (e.g., MMM-Unsplash)
@seann good point, I could just put the collections directly in the module rather than the config, that would do it. @parnic suggested using profile switcher, or at least there may be functionality to grab. I should be able to take it from here – pretty simple. The most time-consuming part will be creating the collection of collections.