Template talk:CnTest
Jump to navigation
Jump to search
Where are the newlines coming from?[edit | hide | hide all]
- It looks like the CreatureNew template refuses to be inside of a paragraph block (<p></p>), even when it is a popup and doesn't actually appear. Is there some way to fix this in the javascript or something for the popupable class? --Legate (talk) 20:42, 21 August 2025 (UTC)
- No idea where its coming from. Do you think it'll be a problem to use string replace like this as a solution? –imahero 21:04, 21 August 2025 (UTC)
- Haha, that is a clever solution for getting rid of an unknown newline! That definitely makes the table nicer, but I think it is actually a paragraph block issue. I can see a structural difference using Chrome's Dev Tools (i.e. right-click>inspect), but I am not yet good enough to be able to trace down how it is getting added. --Legate (talk) 21:21, 21 August 2025 (UTC)
- The solution seems to be to make a separate popupables section. Call [[Template:CnPopup]] with the same parameters as CnTest. Put them all together at the bottom of the page. Should be easy to automate adding CnPopups for all the existing Cn. Are you satisfied with this solution? –imahero 21:52, 21 August 2025 (UTC)
- I've written the code to add equivalent CnPopups for every Cn on each page (namespace=0). I'll run it if you give the go ahead. –imahero 06:02, 22 August 2025 (UTC)
- Hmm - I think I want to look into this more. With the current implementation, I think it might turn into a bit of a maintenance headache. Either every person modifying the wiki is going to need to be mindful about adding the popup info to the bottom of every page they edit, or we are going to have to run your scripts on a regular basis to clean things up. Am I understanding this correctly? If not, please correct my understanding! --Legate (talk) 14:05, 22 August 2025 (UTC)
- I've delved a little deeper. The moment a div is used, it starts on the next line. span doesn't do this. Since CreatureNew uses a bunch of divs, it forces a new line, even if the div itself is hidden. Still trying to come up with a workaround taht can be done automatically in a single template. --Legate (talk) 17:14, 22 August 2025 (UTC)
- [[Template:CreatureNewSpan]] is a failure but maybe it could be adjusted to work with spans? Have to ask Phasma I suppose. –imahero 07:06, 23 August 2025 (UTC)
- I used javascript to change the parent of elements with the class hoverable from p tags into span. So far only affects p tags. Let me know if this fixes and/or breaks anything or if any further work is required. It also moves all popupables from wherever they were to the end of bodyContent. See [[Template:CnTest2]]. Can we replace Template:Cn with [[Template:CnTest2]] now? –imahero 23:50, 23 August 2025 (UTC)
- This still creates a large amount of empty space of void below the body of the page - a minor issue but it still results in pages being strangely long, which I assume is a result of how these popups work?
00:11, 24 August 2025 (UTC)
- Yeah the page being extra long is most likely being caused by the phantom popupables. –imahero 00:20, 24 August 2025 (UTC)
- This still creates a large amount of empty space of void below the body of the page - a minor issue but it still results in pages being strangely long, which I assume is a result of how these popups work?
basic text text lala <div style="display:none">I AM HIDDEN TEXT</div> more things #2
basic text text lala
more things #2