Template talk:ImageLink: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>NXTBoy No edit summary |
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>" Tags: mobile web edit mobile edit |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
:I can see the problem pages, but I can't reproduce it on a new page. Looks like either a caching issue (good), or a template overuse issue (very bad). {{User:NXTBoy/sig|date=16:06, 16 September 2011 (UTC)}} | :I can see the problem pages, but I can't reproduce it on a new page. Looks like either a caching issue (good), or a template overuse issue (very bad). {{User:NXTBoy/sig|date=16:06, 16 September 2011 (UTC)}} | ||
::Compare [[Template:ObjectPage]] with [[RBX.lua.Instance (Object)]]. Not sure why the second doesn't work. {{User:NXTBoy/sig|date=16:09, 16 September 2011 (UTC)}} | ::Compare [[Template:ObjectPage]] with [[RBX.lua.Instance (Object)]]. Not sure why the second doesn't work. {{User:NXTBoy/sig|date=16:09, 16 September 2011 (UTC)}} | ||
:The [[:Template:Derived_classes/link]] page throws <code>Error: invalid title in link at line 3</ | :The [[:Template:Derived_classes/link]] page throws <code>Error: invalid title in link at line 3</syntaxhighlight> if that helps.[[User:Anaminus|--Anaminus]] 18:41, 16 September 2011 (UTC) | ||
::Nope. That's just because the template has no default parameters. Besides, that's not the error we're getting. Try adding <code><nowiki>{{derived classes|Instance}}</nowiki></ | ::Nope. That's just because the template has no default parameters. Besides, that's not the error we're getting. Try adding <code><nowiki>{{derived classes|Instance}}</nowiki></syntaxhighlight> to a new page. It works fine. {{User:NXTBoy/sig|date=19:58, 16 September 2011 (UTC)}} | ||
:Doesn't ImageLink require an ''image'' parameter? [[:Template:Object/image]] doesn't seem to do that. [[User:Anaminus|--Anaminus]] 18:41, 16 September 2011 (UTC) | :Doesn't ImageLink require an ''image'' parameter? [[:Template:Object/image]] doesn't seem to do that. [[User:Anaminus|--Anaminus]] 18:41, 16 September 2011 (UTC) | ||
::Yes, but it's optional. The image parameter adds <code>Image:</ | ::Yes, but it's optional. The image parameter adds <code>Image:</syntaxhighlight> to the front of the url. I needed to put the whole URL in though, so I bodged it so that it uses the first unnamed parameter if no image parameter is specified. {{User:NXTBoy/sig|date=19:58, 16 September 2011 (UTC)}} | ||
:Crap. Looks like a template limit issue. I'll keep testing... {{User:NXTBoy/sig|date=20:24, 16 September 2011 (UTC)}} | :Crap. Looks like a template limit issue. I'll keep testing... {{User:NXTBoy/sig|date=20:24, 16 September 2011 (UTC)}} | ||
Line 17: | Line 17: | ||
:I found out why there are errors. For the ClassLink page, I initially used the [[Template:ifexist]] template to check if the image existed, but it still returned yes despite it not existing. See here: | :I found out why there are errors. For the ClassLink page, I initially used the [[Template:ifexist]] template to check if the image existed, but it still returned yes despite it not existing. See here: | ||
<code><nowiki>{{ifexist|Image:nonexistentimage|yes|no}}</nowiki></ | <code><nowiki>{{ifexist|Image:nonexistentimage|yes|no}}</nowiki></syntaxhighlight> -> {{ifexist|Image:nonexistentimage|yes|no}} | ||
:The errors are appearing because the the images generated from this still don't exist. [[User:Anaminus|--Anaminus]] 20:31, 16 September 2011 (UTC) | :The errors are appearing because the the images generated from this still don't exist. [[User:Anaminus|--Anaminus]] 20:31, 16 September 2011 (UTC) | ||
::It's a casing issue. Try <code><nowiki>{{ifexist|Image:Nonexistentimage|yes|no}}</nowiki></ | ::It's a casing issue. Try <code><nowiki>{{ifexist|Image:Nonexistentimage|yes|no}}</nowiki></syntaxhighlight>. That works properly. This doesn't seem to be the cause of the problem. | ||
==It's a template nesting issue== | |||
It's definitely a template nesting issue. Try testing: | |||
<pre>{{derived classes|Instance}}</pre> | |||
Now try | |||
<pre>{{1x|{{derived classes|Instance}}}}</pre> | |||
And | |||
<pre>{{1x|{{1x|{{derived classes|Instance}}}}}}</pre> | |||
And keep going till it breaks. It just happened that we were right on the edge of the template limit. One more level of indirection (getting a derived image) results in a failure. Until I work out how to solve it, I've made it stick a ? where the error message was. | |||
Here's a demo, nesting {{tl|1x}}: | |||
* Nest 40 templates: {{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|'''Level 40 here'''.}} | |||
}}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} | |||
}}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }} | |||
* Nest 41 templates: {{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x | |||
|{{1x|'''This is level 41'''.}} | |||
}}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} | |||
}}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} }}}} | |||
This behaviour is happening inside {{tl|ifexist}}. | |||
{{User:NXTBoy/sig|date=21:07, 16 September 2011 (UTC)}} |
Latest revision as of 05:26, 27 April 2023
This template seems to be producing this error in certain places:
Error: must specify an image in the first line
--Anaminus 23:04, 15 September 2011 (UTC)
- Which places? What arguments cause that to happen?
- I can see the problem pages, but I can't reproduce it on a new page. Looks like either a caching issue (good), or a template overuse issue (very bad).
- Compare Template:ObjectPage with RBX.lua.Instance (Object). Not sure why the second doesn't work.
- The Template:Derived_classes/link page throws
Error: invalid title in link at line 3</syntaxhighlight> if that helps.--Anaminus 18:41, 16 September 2011 (UTC)
- Nope. That's just because the template has no default parameters. Besides, that's not the error we're getting. Try adding
{{derived classes|Instance}}</syntaxhighlight> to a new page. It works fine.
- Nope. That's just because the template has no default parameters. Besides, that's not the error we're getting. Try adding
- Doesn't ImageLink require an image parameter? Template:Object/image doesn't seem to do that. --Anaminus 18:41, 16 September 2011 (UTC)
- Yes, but it's optional. The image parameter adds
Image:</syntaxhighlight> to the front of the url. I needed to put the whole URL in though, so I bodged it so that it uses the first unnamed parameter if no image parameter is specified.
- Yes, but it's optional. The image parameter adds
- Crap. Looks like a template limit issue. I'll keep testing...
- I found out why there are errors. For the ClassLink page, I initially used the Template:ifexist template to check if the image existed, but it still returned yes despite it not existing. See here:
{{ifexist|Image:nonexistentimage|yes|no}}</syntaxhighlight> -> no
- The errors are appearing because the the images generated from this still don't exist. --Anaminus 20:31, 16 September 2011 (UTC)
- It's a casing issue. Try
{{ifexist|Image:Nonexistentimage|yes|no}}</syntaxhighlight>. That works properly. This doesn't seem to be the cause of the problem.
It's a template nesting issue
It's definitely a template nesting issue. Try testing:
{{derived classes|Instance}}
Now try
{{1x|{{derived classes|Instance}}}}
And
{{1x|{{1x|{{derived classes|Instance}}}}}}
And keep going till it breaks. It just happened that we were right on the edge of the template limit. One more level of indirection (getting a derived image) results in a failure. Until I work out how to solve it, I've made it stick a ? where the error message was.
Here's a demo, nesting {{1x}}:
- Nest 40 templates: Level 40 here.
- Nest 41 templates: This is level 41.
This behaviour is happening inside {{ifexist}}.