Editing
Template talk:CnTest
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Where are the newlines coming from? == * It looks like the CreatureNew template refuses to be inside of a paragraph block <nowiki>(<p></p>)</nowiki>, 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? --[[User:Legate|Legate]] ([[User talk: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? β[[user_talk:imahero|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. --[[User:Legate|Legate]] ([[User talk:Legate|talk]]) 21:21, 21 August 2025 (UTC) ** The solution seems to be to make a separate popupables section. Call <nowiki>[[Template:CnPopup]]</nowiki> 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? β[[user_talk:imahero|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. β[[user_talk:imahero|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! --[[User:Legate|Legate]] ([[User talk: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. --[[User:Legate|Legate]] ([[User talk:Legate|talk]]) 17:14, 22 August 2025 (UTC) *** <nowiki>[[Template:CreatureNewSpan]]</nowiki> is a failure but maybe it could be adjusted to work with spans? Have to ask Phasma I suppose. β[[user_talk:imahero|imahero]] 07:06, 23 August 2025 (UTC) **** Spans are all inline elements so not possible I'm afraid - it will always run down the page like that example shows. Divs are block elements that will allow you proper vertical alignment, but spans will not. [[File:Hero Cosmos small.png|link=user:phasma|β Phasma]] 14:21, 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 <nowiki>[[Template:CnTest2]]</nowiki>. Can we replace [[Template:Cn]] with <nowiki>[[Template:CnTest2]]</nowiki> now? β[[user_talk:imahero|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? [[File:Hero Cosmos small.png|link=user:phasma|β Phasma]] 00:11, 24 August 2025 (UTC) *** Yeah the page being extra long is most likely being caused by the phantom popupables. β[[user_talk:imahero|imahero]] 00:20, 24 August 2025 (UTC) <pre>basic text text lala <div style="display:none">I AM HIDDEN TEXT</div> more things #2</pre> basic text text lala <div style="display:none">I AM HIDDEN TEXT</div> more things #2
Summary:
Please note that all contributions to Heroes 3 wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit
Add topic
View history
More
Purge
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information