Template talk:Infobox road

message: Are there any plans to convert parts of this infobox to Lua, specifically the shield, route name, and translation?  Now that we have fairly robust road data modules, I think these three items should be handled by the road data modules.  Yes, I know that these will eventually be handled by Wikidata, but who knows when that will happen?  We can use Lua now.
For those locations that don't yet have a road data module, we could utilize a tracking category to catch them, but I don't think there are very many. –Fredddie™ 16:01, 16 May 2015 (UTC)
replies: text: There's no reason why we couldn't have the shield handled by Wikidata, similar to how the maps are now, though Happy might be waiting on other development last I heard (several months ago). --Rschen7754 16:04, 16 May 2015 (UTC)
replies: text: Yes, my Summer of Code development.  I have no problem with migrating the infobox shields, names, and translations over to the road data string modules. That can be done right now while we're waiting for the corresponding Lua code, since adding unused keys won't cause any errors. The only issue with using shields from Wikidata is an override for highways with non-free shields. I would also like to migrate the colors to the string modules at some point. As for the rest of the infobox, I'm still waiting for mw:Extension:Capiunto to be deployed. -happy5214 00:42, 17 May 2015 (UTC)
replies: text:  do you have anything to report from the last four months? –Fredddie™ 01:37, 3 September 2015 (UTC)
replies: text: No, nor might I have anything over the next four months. Feel free to migrate the infobox-specific data to the string modules, but module development has been stalled due to lack of progress on Capiunto and my own personal inactivity. -happy5214 07:13, 3 September 2015 (UTC)

text: I have a few concerns about doing this now, although I'm sure it will be done eventually. Do you happen to know how quantities with units are handled in the Wikibase Lua library? Are unit conversions available from the library, or will client code (Infobox road/length) still be required to convert between miles and kilometers? -happy5214 11:10, 9 October 2015 (UTC)
replies: text:  I don't think there is special handling (yet) in the Wikibase lua library for quanitites (e.g. conversion), but there is Module:Convert. What (else) do you have in mind that we need in the lua library?  Suppose for now, I could help with adding this data to Wikidata and maybe experiment with lua in a sandbox module. Aude (talk) 12:29, 9 October 2015 (UTC)
replies: text: Since I already have unit conversion code in my module, I guess all I would have to have is a way to determine the unit used for the statement. -happy5214 03:32, 10 October 2015 (UTC)
replies: text: In the past, the only reason we never used  was because we wanted it to appear <length><reference> (<conversion>).  So long as that's preserved, there will be no opposition from the "it's always been that way" lobby. –Fredddie™ 13:02, 10 October 2015 (UTC)
replies: text:  now that I've thought about it for a little while, you really shouldn't need units.  There are only a handful of countries (US, UK, Liberia, maybe one more?) that use miles for anything, so the country property should influence what unit is used. –Fredddie™ 14:11, 10 October 2015 (UTC)
thread_title:  Luafication 

message: For the past week, I have been converting this template into a Lua module.  The sandbox now does not transclude templates, except for certain fallbacks where (1) arguments to the live template need to be changed (discussed in issues below), and (2) data are yet to be defined in road data modules.  There was a lot of data movement, and I think I am at a point to request for comments on where I decided to put things.
The goal is to use road data modules as much as possible.  For USA, the following data are to be moved to road data modules (see Module:Road data/strings/USA and Module:Road data/strings/USA/NH for examples of an updated modules):
* shieldmain: moved from Template:Infobox road/shieldmain/USA to each state's road data module.  Defaults to shield if undefined.
** shieldmainsize: size for shieldmain if it were to be displayed in .  Defaults to shieldsize if undefined.
* name: moved from Template:Infobox road/name/USA to each state's road data module.
* translation: moved from Template:Infobox road/translation/... to each country's road data module.  (I have yet to test this.)
* law: moved from Template:Infobox road/law/USA to each state's road data module, if defined.
* maint: moved from Template:Infobox road/maint/USA to each state's road data module.
* browse: moved from Template:Infobox road/browselinks/USA to each state's road data module.  Since browse links may be associated with route types or states, these links have to be moved to two places:
** For links associated with route types, these move to the definition of the route type, e.g., USA.I.browse.
** For links associated with states, these move to the common section for each state, e.g., NH[" common "].browse.
** By default, the common browse is shown, but this might be undesirable for certain route types, e.g., county routes.  To disable common browse, such route types may specify nocommonbrowse = true in the definition of the route type.
* aux: moved from part of Template:Infobox road/meta/spur of to each stata's road data module.  This is the full wiki markup describing auxiliary types, e.g., Business route.  Lua loops can be used to fill these out automatically without explicitly writing them down.
** For an irregular route that is auxiliary, but their route type is not auxiliary in general, e.g., New Hampshire Route 3A,  can be specified, where spec_auxtype is auxiliary code such as Alt and Bus.  The definition of these types is at USA[" aux "].aux.  This can be further overridden by providing full wiki markup in .  Defaults to Auxiliary route if none of these is unspecified.
For other countries, the data are to be moved to road data modules in a similar way.
Some data remain in the Infobox road namespace, because they govern how data are displayed and not themselves data:
* Section colors remain in Module:Infobox road/color.
* Module:Infobox road/display: moved from all of Template:Infobox road/hide/....
These modules are structured so that they can be fetched with mw.loadData.
Issues
*  should be deprecated, since  can now include auxiliiary types directly, as in US-Alt.  Moreover, certain route types have multiple subtypes, e.g., US-Truck-Alt.  This change will make route types consistent with .  Transclusions using this parameter must be modified as part of the transition.  To help with this, the sandbox concatenates subtype to type before invoking the road data module.
* Translations depend on , which I don't know how to replace with modules yet.
Additional features
These are incorporated from past discussions and are independent of the transition.
* Added support for nested infobox.
* Automatically display country and state (without wikilinks for now).
Dependencies
Future work (we should discuss)
* Rework the location section to allow custom labels (e.g., rural municipalities, divisions) instead of dedicated parameters.  There are too many of them now, and I think these could get out of hand.
* Rework the browse section to break things up from the current browse parameter.  For example, multiple rows of previous and next routes can be specified with numbered suffixes, in the same way as multiple route sections.
Template:Infobox road/testcases and its subpages may be of your interest.  Some shields therein might be incorrect because road data modules need an update.  While the current sandbox is robust enough for the transition, template warnings should be inserted first so transclusions needing corrections can be readily identified.  Chinissai (talk) 11:14, 6 May 2016 (UTC)
thread_title:  RFC: Transitioning to Lua module 

message: Some of you have probably seen me tooling around in the Road data modules the last couple weeks and have been wondering what I'm doing.  In short, I am taking it upon myself to Luafy the infobox.  There are a few modules that I'm working on; here's where I'm at and how you can help:
;Module:Infobox road/route
:This is what will draw the shields and put the name of the highway.  For this to work properly, we need to add a couple parameters for full functionality:
:#shieldmain: For instance, this will call specific shields where we use generic shields in Jct.  Think  instead of .
:#name: This is the name of the highway without the state modifier, e.g. State Route 1 instead of California State Route 1.
:At present this module works almost as intended.  I have even written in the ability for names to go above shields (Australia) if desired.  Earlier I had written it so it will take accept shield if shieldmain doesn't exist.  I took it out, but I'm really thinking of putting it back.
:Multiple shields is the one thing that still doesn't work.  Currently,  accepts only 2 shields per route and I borrowed the code from Jct for this module. I'd like to increase that up to 4 infobox shields for Puerto Rico.  In addition, shieldmain does not work with the current multiple shield code, so that needs to be addressed as well. 
::NB: this will be used in  as well when the kinks are worked out.
;Module:Road data/size
:This controls the size of the shields that Module:Infobox road/route uses.  I wrote this with the idea that it will be used to control the shield size in this infobox, , , and .  I added an orientation parameter to the road data string modules for files that are taller than they are wide.  What this will do remove the x on the shield size.  The default infobox shield size is "x70px"; with orientation = "upright", it would be "70px" instead.  The module works great except for one pesky thing: the size module doesn't read orientation at all. 
:So if you know of any "upright" shields, you can add orientation = "upright" to the appropriate type in its road data string module.
;Module:Infobox road/sandbox and Module:Infobox road/color/sandbox
:What I am doing here is migrating the original color module to Template:Infobox road/styles.css so we can utilize WP:TemplateStyles.  Currently, I have am using the color sandbox to filter the types and call the correct style that way.  However, if you look at Template:Infobox road/testcases, you will see that it is not working.  I also added the "hard coded"  colors so they will override any module.
:As I ponder how to continue with this, I'm thinking the best way is to call the color parameter in the road data string modules.  It would eliminate the need for the color module entirely.
So yeah, that's what I've been doing.  I really don't know what I'm doing, and I'm amazed I've gone as far as I have.  I wanted to thank  and  for answering my Lua questions when they arise.  This has been a fun challenge and I think it'll be great for the encyclopedia when it's done.  If you have any questions, comments, concerns, or requests, fire away. –Fredddie™ 23:44, 19 February 2021 (UTC)
replies: text: A quick update, Module:Infobox road/route is now working great in concert with Module:Road data/size.  You can see it working at Template:Infobox road/testcases.  Shields are now sized independently, so if you have a taller shield and a wider shield in your shieldmain table they will be sized accordingly!Now I turn my attention to the colored headers. –Fredddie™ 01:48, 7 March 2021 (UTC)
thread_title:  Updates 

message: Hi, I'd like to change the icons in the infobox under "Highway system" for Indonesian highways (see for instance Indonesian National Route 11), but I'm having a hard time finding where these are defined. I've already changed the icons from .png to .svg in another part of the template, to give you an idea of what I'm trying to do. Can anyone help me out? ReneeWrites (talk) 16:44, 31 October 2023 (UTC)
replies: text: Most of the people who did all the coding for this template are among the editors who have left the project and now work on the AARoads Wiki. Your best bet is to contact one of them, and ask them where to look.  I'd start with User:Fredddie. Dave (talk) 18:23, 31 October 2023 (UTC)
replies: text: It looks like it's the shield param in Module:Road data/strings/IDN. -- WOSlinker (talk) 19:36, 31 October 2023 (UTC)
thread_title:  Can't find source for highway icons 

message: On line 198: from .header-ESP-A, .header-ESP-AP { to .header-ESP-A, .header-ESP-AP, .header-ESP-Autovia, .header-ESP-Autopista {. In articles about motorways with prefixes different from AP- or A- we can't use type=A or type=AP, as this would generate an incorrect link to the shield image (for example, Autopista GC-1). Santi2222 (talk) 15:29, 27 March 2024 (UTC)
replies: text: * Pppery * it has begun... 01:20, 31 March 2024 (UTC)
thread_title: Edit request