Template talk:Infobox nutritional value

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Food and drink (Rated Template-class)
WikiProject icon This template is within the scope of WikiProject Food and drink, a collaborative effort to improve the coverage of food and drink related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 Template  This template does not require a rating on the project's quality scale.
WikiProject Health and fitness (Rated NA-class)
WikiProject icon This template is within the scope of WikiProject Health and fitness, a collaborative effort to improve the coverage of health and physical fitness related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 NA  This template does not require a rating on the project's quality scale.

TfD nomination of Template:Nutritionalvalue[edit]

Template:Nutritionalvalue has been nominated for deletion. You are invited to comment on the discussion at the template's entry on the Templates for Deletion page. Thank you. --Mike Sorensen 00:10, 21 November 2006 (UTC)

There is no such word in English language as "nutritionalvalue" and therefore the concocted word "nutritionalvalue" is not verifiable, not notable and flat out nonsense. Additionally, this is just an incomplete template that servers no purpose and it is misleading in its current state as any nutritional amounts are only "recommended" and not absolute amounts and as such should be supported by sources and references and should indicate if they are RDI for male, female, child, infant, etc. In the "Example" herein the amounts have no reference and they are fictitious and incorrect. --Mike Sorensen 00:10, 21 November 2006 (UTC)

What do you think?[edit]

OK, enough playing for tonight. Let's see whether people start using it in articles. I can think of many refinements, such as

  • nicer layout and color scheme;
  • things like vitamins as a percentage of the recommended daily allowance;
  • enable right as option instead of right=1,

but all this is of no use if the template isn't used. I wonder why this idea isn't already in wide use. Is it against wikipedia policy? There are two other templates which are used in very few places:

I think they look nicer, but this one is more flexible. Han-Kwang 23:42, 15 June 2006 (UTC)

I notice this just got added to Butter, a featured article. I have several issues with the addition:
  • Its appearance is pretty unattractive right now. Columns don't line up, some text is rammed together, etc.
  • It doesn't specify a source. This is a crucial problem.
  • An overall US-centricism, using US facts and US RDAs.
For these reasons I am removing the template from butter; I would suggest these issues be resolved before the template is widely applied. —Bunchofgrapes (talk) 18:57, 24 June 2006 (UTC)
Thank you for your comments.
  • Re source: For all boxes I added so far I used the USDA database. Would you suggest adding a line in the box with a link to this database?
  • Re US-centrism: do you have an alternative? Are there large differences in RDA values between US and other countries? I don't think the numbers for various food products themselves are particularly US-biased, but the RDA values might. The alternative would be to just list quantities in mg, but even after adding some 20 of these boxes to various articles I can recall the numbers for only a few of the vitamins and minerals. At least RDA values should give a rough indication. One could make an article with the RDA values for various countries and link to that from this box, how about that?
  • Re appearance: this is a relatively minor issue. The idea of having non-aligned columns is that the numbers in the middle column add up to numbers in the rightmost column. The nice thing of a template is that you can change the layout independently of the data.
Han-Kwang 20:21, 24 June 2006 (UTC)
Re Source: I'd suggest a template param that let you specify an URL to the source, or something like that. Re US-centricism: Did you know that butter has a higher percentage of fat in Europe than in the U.S.? Significant regional differences in even basic foods exist. Compound that with recommended values like RDAs, and I'm quite uncomfortable that this template may encourage an oversimplified, region-centric view. —Bunchofgrapes (talk) 21:04, 24 June 2006 (UTC)

English language version[edit]

Could an English (as opposed to American) version be made, with fibre in place of fiber? The current American version looks very incongruous on pages that are otherwise in British English (e.g. Common Hazel) or Commonwealth English (e.g. Banana) - MPF 16:23, 10 July 2006 (UTC)

I never thought of that, but yes of course. I changed the template and the two articles you mentioned. Han-Kwang 20:28, 10 July 2006 (UTC)
Many thanks! There'll be a few others as well - basically, any crop with Old World origins is (or should be!) at UK, Commonwealth, etc., spellings - MPF 22:11, 10 July 2006 (UTC)

Nominated for deletion[edit]

There is no such word in English language as "nutritionalvalue" and therefore the concocted word "nutritionalvalue" is not verifiable, not notable and flat out nonsense. Additionally, this is just an incomplete template that servers no purpose and it is misleading in its current state. Any nutritional values should be supported by sources and references.

Disagree. The name of a template, in this case "nutritionalvalue", does not necessarily have to be a real word in itself. The name should be concise and easy to remember as well as meaningful to the function of the template. Since this template serves as a way of providing nutritional information on articles relating to food or whatnot, and the name of the template conveys that purpose well, I do not feel it needs to be changed. Furthermore, if you have a problem with the name of the template, discussing a new name for it in this discussion page (rather than suggesting the template be deleted) is the proper way to get it changed. As for the template being useless or misleading, I fail to see your reasoning behind such a claim; the template is neither useless (it provides useful information in relevant articles) nor misleading (the usage of the template is clear by reading the annotations on the actual template page and the template itself is easy to interpret). --Fnar(talk) 21:38, 19 November 2006 (UTC)
This is encyclopedia and not "Make-it-yourself pedia"
If we go by your guidelines then we will open doors to more spam, as it will allow people to create their own nonsense words and then claim that they should be in wikipedia because they are "concise" and "easy to remember".
As far as being misleading the template contains info such as "Riboflavin (Vit. B2) 2 mg - 133%" which is a nonsense because it is at best a recommended nutritional amount as stated by some regulatory or advisory panel or group. As those guidelines vary from country to country and from one research paper to another, (not even mentioning from one human being to another) stating any numbers in a template about nutritional values should be supported by references . The word "recommended" , that is not even mentioned here, is rather important in this case. Therefore in its current state the template is misleading and useless. Furthermore there is nothing wrong with English words "Nutritional Value" and there is no need to create some concatenations of those words. — Preceding unsigned comment added by Mike Sorensen (talkcontribs)
Disagree - I wouldn't mind if the template is moved to "Nutritional Value" with a space and/or capitalization, or "Nutritional information", or something else within reason, if that makes Mike more happy. But he will also carry the burden of updating all the referring articles, because I won't be doing that. The footnote mentions that it is "US RDI for adults". I was assuming that the R in RDI stands for "recommended" as in RDA, but it actually means "Reference". I'm willing to change the footnote text into "US recommendations for adult males" and update the values (they are now averages of adult males and nonpregnant females). You may not agree with the USDA recommendations, but the source of the numbers is clearly mentioned and verifiable. I think it is rather inappropriate to propose a deletion for a page that could be modified to alleviate your concerns. Han-Kwang 21:21, 20 November 2006 (UTC)
This article can not be modified because in its title there is a word that does not exist in English language. I have no problem with moving the content, assuming that it is updated and corrected, but please refrain from making statements such as: "...he will also carry the burden of updating..." . I is not your business to assign any burdens to me. You created an article with an erroneous title in the first place, so if you want it to be moved or preserved than it is your burden to move it and not somebody else's.--Mike Sorensen 23:43, 20 November 2006 (UTC)
Um... use the move tab at the top of the screen to move it...? -Amarkov blahedits 00:56, 21 November 2006 (UTC)
Mike, the template name is only visible to editors, not to someone who just reads an article, so the name isn't that relevant IMO. I personally don't see the need to spend a lot of time in changing this, but if you see it as a problem, then be bold and fix it. Again, if you want to move the name to a proper English name, and update all referring articles, then I am completely fine with that. After that, you can also open the discussion on other templates with non-English names such as {{prod}} (the one you used to start this discussion), {{test2}}, {{inuseuntil}}, {{TotallyDisputed}}, {{tl}}, {{dabneeded}}, {{otheruses2}}, and so on. Han-Kwang 10:22, 21 November 2006 (UTC)

Font size too small[edit]

Can we increase the font-size, to 90% at least (the size of {{reflist}} contents), to increase readability? I'm going to be bold and do this, but revert if there are problems or objections. Thanks. -- Quiddity (talk) 21:47, 25 April 2008 (UTC)


Any chance this template could be made collapsible? I think it's a great addition to wikipedia, by the way. - TheMightyQuill (talk) 23:50, 11 May 2008 (UTC)

Error while using value {{#expr:}} in template[edit]

Hi, I copied this Template to gu.wiki. The problem I am facing there is, wherever the value {{#expr:}} appears in template, in the actual page it is replaced by an error message reading "Expression error: Unrecognised punctuation character "�"%". Can you please advise why it would be and how to fix it? Thanks in adviance.-- DhavalTalk 12:40, 22 July 2008 (UTC)

It is resolved, i was trying with the numbers typed in Gujarati Script.-- DhavalTalk 12:26, 23 July 2008 (UTC)

Fold heading line[edit]

I like the template, but I suggest that the heading line should be folded to the optimal width of the rest of the HTML table. Otherwise longer titles cause wasted horizontal space, for example as in Chickpeas#Nutrition. -Pgan002 (talk) 01:35, 9 August 2008 (UTC)

Three columns and alignment[edit]

I think the first column of the table should be split into two: nutritional element and mass content. The third column should remain the proportion of recommended daily value.

The first column should be right-aligned, so that the lines are easier to follow. Currently it is left-aligned, which makes it hard to see the percentage value corresponding to short entries in the first column (nutritional element), when there are long entries in the table. -Pgan002 (talk) 01:43, 9 August 2008 (UTC)

The problem with the three-column idea is that the carbohydrates and fats are subdivided into sugars/starch/saturated/unsaturated etc, and that aligning all the masses would give the false impression that fats and unsaturated fats should be added up.
RDI values do not make much sense for carbohydrates/proteins/fats, since they are very dependent on sex, age, body size, and activity pattern. One-size-fits-all RDI values for vitamins are already a bit questionable, but they are taken to be for the most demanding age group and for vitamins it generally doesn't hurt to take two tims more than the RDI, unlike for the c/p/f intake.
The reason I didn't put the masses of the vitamins and minerals in a column is that for the vast majority of the people, the numbers would not mean anything. I've added quite a few tables to articles and I still don't know the RDI values for most vitamins and minerals. Putting them into a column of their own would put too much emphasis on mostly meaningless numbers. If anything, I'd rather typeset the numbers in a grey color to make them even less visible.
Regarding right-aligning columns; there is a reason that this is generally not done in tabular data. Although it is slightly easier to follow horizontal lines, it gets much harder to search vertically for a keyword in a long list. It would be better to have the table rows in alternating colors, or with faint horizontal lines inbetween. Unfortunately it would add an enormous amount of mark-up to the HTML code because it is AFAIK not possible to add specific CSS rules to an article.
13:35, 9 August 2008 (UTC)

Support for manganese added[edit]

I added support for manganese, using an RDI of 2mg. We can now change articles about foods that contain manganese to include their manganese content (eg see Grapes which initially included manganese as an option). NerdyNSK (talk) 20:18, 21 August 2008 (UTC)

HTML wikimarkup vs wikitables[edit]

The documentation for this template said:

"Maybe someone can do this in wikitable format rather than raw HTML, if you know how to combine that with the {{#if: }} conditionals."

I removed that part since that is a bad idea. First of all, the HTML we use in articles and templates isn't really "raw HTML", rather it is "HTML wikimarkup" since it is parsed and converted to XHTML by MediaWiki just like the wikimarkup is.

Using HTML tables are superior to wikitables for a number of reasons:

1: If you use wikitables then you need to escape most of the pipes "|" by using the {{!}} template. That makes the code very hard to read which causes mistakes when programming it, and it costs a lot of transclusions of the {{!}} template which costs more server load.

2: Since other wikimarkup such as {{#if: }} statements and [[Image:|]] statements also contain a lot of braces and pipes it becomes hard to read the code if the table itself consists of braces and pipes. Thus using HTML wikimarkup is simply more readable and causes less human mistakes.

So there simply is no reason to use wikimarkup for complex tables. Wikitables are merely a quick markup to use for small simple tables if one feels that is more to ones liking.

--David Göthberg (talk) 22:27, 14 September 2008 (UTC)

Notwithstanding your arguments, someone changed the table formatting today to wikitable syntax. I'm not sure what the advantage is, but in any case I would suggest that this kind of big changes are tested in a sandbox first so that it doesn't mess up the 150+ articles that use the template. Han-Kwang (t) 20:15, 19 October 2008 (UTC)
Well, there is no advantage in changing to wikitable syntax, only drawbacks. And removing the indentation makes it much harder to edit. It's hard to see what other changes Ed g2s did today, and he doesn't explain anything in his edit comments. Some changes I can see are:
  • He removed the possibility to choose between left and right alignment of the box.
  • He made the box right aligned instead of left aligned.
  • He made the box use the infobox class.
And he did not update the /doc page accordingly and did not explain here on the talk page. If changing to the infobox class was the purpose then that could have easily been applied in the existing HTML table. Or he could have called the {{infobox}} template. I think we should simply revert his edits until he properly explains their purpose. Although I am not really involved in this template other than that someone (I think it was Nihiltres) asked me some time ago to fix some problems with this template, so I fixed the problems. I would like to hear the comments from some other users on this page before we do the revert.
Han-Kwang: I agree. Edits to complex templates or when the editor is not absolutely sure what result the edit to the template will cause should be performed in the /sandbox subpage of the template, or in a subpage in the user's own user space. And I told Ed g2s so on his talk page already before I saw your comment here.
--David Göthberg (talk) 15:18, 20 October 2008 (UTC)
I didn't revert since Ed g2s seems to be an experienced editor and the new template looked OK, but I didn't realize that the alignment options had changed (causing problems in transcluding articles), so I reverted. Han-Kwang (t) 15:45, 20 October 2008 (UTC)

<< OK, the float bug is fixed now; apparently the whole change was cosmetic.[1] However, I'm not very happy with the new layout. I think one reason that I did not use standard wikipedia CSS classes was that they seem to have too much spacing between the table lines for a table with so many single-line rows as this one. The division of the table into header, main, and footer sections is also gone, it's all one big blob of black-on-white text now. I did not give a lot of thought to my color scheme and it probably could use some improvement, but I don't think the present version is an improvement. Also, all the numbers are now aligned on top of each other, e.g. fats 10 g of which saturated fats 4 g and polyunsaturated fats 2 g; putting them on top of each other suggests that the numbers should be added to 16 g of fat. I don't want to get involved in an edit war, but I'd really invite Ed g2s to work on a new layout in a sandbox and discuss the merits of it first. Han-Kwang (t) 16:49, 21 October 2008 (UTC)

I agree. The previous design for this template is much better. That is, text and numbers alignment, size, padding and so on was better. And marking the top and bottom section with another background also made it more readable. As you say, this template needs the more tighter design since otherwise it becomes so huge. The only thing that perhaps should be done is to tweak the colours to be like in the {{infobox}}.
I also preferred the smaller example that it showed as default, with only the required variables showing. The rest is instead nicely shown in the documentation further down. And that also kept the template code much simpler, instead of adding lots and lots of noinclude tags like Ed g2s had done.
And Ed 2gs has not yet explained or motivated his edits. Thus, I too have now reverted Ed 2gs' edits.
--David Göthberg (talk) 12:10, 23 October 2008 (UTC)
There are many good reasons to the infobox class. Using hard coded styles may cause problems when viewing Wikipedia in anything other than the default skin. The infobox class is used on 99% of infoboxes on the site, so I can't see how we can raise any objections to the padding here. If there's a lot of data that needs to be smaller, then by all means tweak the template to make the font size smaller. Using hard coded styles and fixed colours should be avoided in favour of semantic css and markup. ed g2stalk 12:41, 27 October 2008 (UTC)
Ed, I think you are an admin, so I would expect from you that you don't get yourself involved in edit wars if you see that there are legitimate concerns about your edits. I'm not saying that the template must stay the way it was, but I and David have asked you several times to work on your version in the template sandbox and discuss proposed changes, but so far you don't seem to seek any kind of consensus, and rather just push through your version. Han-Kwang (t) 15:53, 27 October 2008 (UTC)

Reopening this debate[edit]

I don't think that the argument that wikitable syntax makes the template less maintainable holds any water. The recent change of the template name to add a space broke the sandbox: I've fixed this, and will work on transitioning the current code over to wikitable format with a view to eventually moving to a derivative of {{infobox}} (which is far easier from wikitable syntax than raw HTML). The actual styling of the current template can easily be retained. Chris Cunningham (not at work) - talk 08:30, 17 June 2009 (UTC)

Done. Template:Nutritional value/sandbox has a completely wikitable version of the current code, weighing in at a svelte 6,250 bytes, with exactly the same output. It doesn't need indenting to be readable, unlike the HTML version, and it shouldn't even be that difficult to merge the inner table into the outer (which will simplify if further). Chris Cunningham (not at work) - talk 09:07, 17 June 2009 (UTC)
{{editprotected}} Requesting sync with the sandbox as there has been no opposition to this. Chris Cunningham (not at work) - talk 19:38, 30 June 2009 (UTC)
Not done: template not protected! — Martin (MSGJ · talk) 21:54, 30 June 2009 (UTC)
D'oh! Anyway, this has now been synced. Chris Cunningham (not at work) - talk 07:56, 1 July 2009 (UTC)

kCal vs. kcal[edit]

The template page says:

Note - 1 kJ = 4.2 calories (kCal).

Base off of everything that I have seen, plus a little google calculator, 1 kJ = 4.2 calories (kcal). Basically, the question I have is should the abreviation of calories in the template be kCal or kcal? After all, a 1 Calorie is equal to 1000 calories. Zharmad (talk) 17:47, 30 June 2009 (UTC)

A little research and I answered my own question. Zharmad (talk) 17:51, 30 June 2009 (UTC)
But the number was the wrong way around, it should be 4.2 kJ = 1 kcal. The template math was right, though. Fixed. Han-Kwang (t) 08:17, 2 August 2009 (UTC)

Remotely encyclopedic?[edit]

Is this infobox remotely encyclopedic? Wikipedia isn't a food guide or diet guide, and the random nutritional content of most food doesn't seem remotely notable unless there is some controversy or scientific claim made about the food at which point only that nutritional content seems to be worth noting nor does it seem like it would lead to any greater understanding of the subject.--Crossmr (talk) 01:42, 24 August 2009 (UTC)

Precision of Food Energy Values[edit]

Is there a reason why the kilo Joule values are rounded to the nearest tenths? I know this values are merely guidelines, but I still think it would be best if the numbers appear as they do from the sources, and not have them modified by the template.
Also the conversion factor of kJ to kcal is 4.1868 but the template just uses 4.18. Should these things be changed for better precision? Aezay (talk) 19:36, 3 September 2009 (UTC)

left aligned?[edit]

Is there any way to put the box on the left side of an article? "|right=no" doesn't seem to do anything. Thanks, BanyanTree 04:07, 30 July 2010 (UTC)

Good question. I made some adjustments. Try "float = left". The old method was somewhat pointless since the default is already to float right. Plastikspork ―Œ(talk) 05:02, 30 July 2010 (UTC)
Thanks muchly! - BanyanTree 05:51, 30 July 2010 (UTC)


The formatting of the template needs to be improved.

  • Line spacing is too high. This wastes space and makes the infobox look ugly.
  • The items that are sub-parts of other item should be indented. For example, saturated fats and unsaturated fats are included in (total) fat, so they should be indented to point out this fact.
  • It would be better if the sub-parts (such as saturated and unsaturated fats) were not boldface.
  • Why does Energy line have grey background?

I tried to change the line spacing in the sandbox, but I could not find a way to do that. --PauliKL (talk) 11:39, 10 October 2010 (UTC)

Wrong values[edit]

according to http://en.wikipedia.org/wiki/Reference_Daily_Intake - at Thiamine - should be 0.015, not 0.013 - at Riboflavin - should be 0.017, not 0.015 - at Niacin - should be 0.2, not 0.15 and so on...

Also, I don't see why IU % for Vitamin A should be removed, as the RDI has a value, 5000. — Preceding unsigned comment added by Mariansavu (talkcontribs) 22:28, 21 June 2011 (UTC)

I just added VitA as beta carotene in IU as well as VitE in IU as options. Tested them on sandbox and they work well.  Leef5  TALK | CONTRIBS 14:18, 18 August 2011 (UTC)


Why isn't there a parameter for copper? Sasata (talk) 19:52, 12 September 2011 (UTC)

I don't know the answer either, but there is also missing the parameter for fluoride and selenium. —Götz (talk) 20:34, 21 April 2014 (UTC)

hyphens, dashes, bullets[edit]

Please exchange hyphens for dashes where appropriate, as those are different characters (just as exclamation and question marks are different) with different functions (please see MoS:PUNCT > MoS:HYPHEN & MoS:DASH). Alternatively, you probably could use bullets, maybe that's even the better option, I don't know. – ὁ οἶστρος (talk) 14:13, 25 January 2012 (UTC)

Recommended value is daily[edit]

As of today the template generates

Percentages are relative to
US recommendations for adults.
Source: USDA Nutrient Database

To make sense, "daily" should be included somewhere. I think that is essential.

As a secondary comment, this can be shortened a bit. "Percentage" implies "relative", we don't need both words. The abbreviation "RDI" or "RDA", with link, is perhaps acceptable.

Being a fan of brevity, I'd go so far as
Percentages: of US adult RDI
Source: USDA Nutrient Database

But the inclusion of "daily" somewhere (even just as "RDI/A") is necessary. If my short version goes to far, there;s plenty of space for

Percentages relative to US
adult daily recommendations.
Source: USDA Nutrient Database

Pol098 (talk) 20:06, 8 July 2012 (UTC)

food variability[edit]

Should we note in the template that food can be very variable? --Wikiloop (talk) 21:49, 8 October 2013 (UTC)

trace metals ?Shouldn't it be trace minerals ?[edit]

Not all minerals are metals. e g. P — Preceding unsigned comment added by Vwalvekar (talkcontribs) 05:01, 3 August 2015 (UTC)

contradiction in %DV with nutritiondata.com[edit]

There is significant differences in %DV values for many items such as rice, wheat, pigeon pea etc when compared to those in nutritiondata.com. Both claim USDA as their source.! — Preceding unsigned comment added by Vwalvekar (talkcontribs) 05:05, 3 August 2015 (UTC)