#Inserting links into braces

87 messages · Page 1 of 1 (latest)

mint violet
#

I've borrowed a template I've from Wikipedia which creates a visual of geological ranges. The issue is, I can't seem to insert links into the bracketed entries. Here's what I'm working with.

#

And this is what happens when attempting to redirect to Wikipedia, as the page does not exist on my Wiki. The bar erroneously stretches instead and yields "Expression error: Unexpected < operator."

#

{{period start|Cambrian}} might require changes, but changing subsequent internal links to interwiki ones still breaks the template

rich summit
#

Link to that page?

#

The images aren't that great

marsh badger
#

Put the <span> outside the wikilink?

#

The red text tells you what the problem is

mint violet
mint violet
#

Either way though, removing it still creates the issue, so it's not <span> that's doing it. The other angle brackets are part of the <div style>, which I've tried but can't remove without breaking things.

rich summit
#

Do you have all the templates and modules?
Like Template:Period color?

mint violet
#

I do; just kept the essentials though since I don't need the protection modules/templates yet

rich summit
#

I get that, I don't use them either

marsh badger
#

Can you please post a link to the problem on your own wiki? Like it asks you to do when you create a post?

rich summit
marsh badger
#

That's a wikipedia link.

rich summit
#

Read the message after it

marsh badger
#

It's really hard to debug a bug with someone else's correctly working example ¯_(ツ)_/¯

rich summit
#

Yeah. same

#

Can't replicate what you can't see

marsh badger
#

It looks like {{period start|Cambrian}} returns an HTML tag rather than a number.

#

and then {{#expr:}} dies because it sees a math equation beginning with a less than sign.

mint violet
rich summit
#

Too me this looks all working right!?

mint violet
#

The bar itself is fine; it's the linking that's messed up

#

Currently, clicking the "Ꞓ" on the bar takes you to the local wiki's Cambrian page, which doesn't exist. I want it to go to Wikipedia's page instead.

rich summit
#

okay

mint violet
#

PreꞒ is the only one I can get to use an interwiki link because it doesn't follow the same format

rich summit
#

Let's see..

marsh badger
#

You need to edit Template:fossil range/bar

rich summit
#

Yeah, it is a redirect on Wikipedia too

marsh badger
#

[[{{{1}}}|{{{2}}}]] -> [[w:{{{1}}}|{{{2}}}]]

rich summit
#

Ah you skipped the redirect

marsh badger
#

Yeah, you could also just Interwiki redirect those pages (which is useful but makes it annoying to edit later)

#

#REDIRECT [[w:Cambrian]] would actually work.

rich summit
#

I personally find it annoying to get directed to a page where you ned to click again to get to the page you want.

#

But it is a possibillity indeed

#

Yeah works fine now doesn't it?

mint violet
rich summit
#

Let me see the code again 😉

mint violet
#

Much appreciated folks 🙌

rich summit
#

Try adding |alt={{{2}}} behind |{{{2}}}

#

[[w:{{{1}}}|{{{2}}} |alt={{{2}}}]]

marsh badger
#

he means [[w:{{{1}}}|{{{2}}}|alt={{{1}}}]]

rich summit
#

Right you are

#

Sorry

mint violet
rich summit
#

Okay, that didn't work

#

I don't have another solution to remedy this. Normally one should be able to put an alt in

marsh badger
#

I think the alt thing only works on images.

rich summit
#

Hmm, You might be right

#

Let's greate a task for that 😄

#

But i all seriousness.. if it doesn't bother you too much, leave it. It works, and people know there goint to a Wikipedia page

#

tey're*

#

they're*

mint violet
#

I'm not obsessed enough to make it my white whale, so I probably will leave it be. Might just try <span> one final time since that worked for links previously.

#

Thanks for the help, both of you. Only other issue I've got left to squash is that troublesome taxobox color assignment issue. Might actually stem from something similar to [[{{{1}}}|{{{2}}}]] -> [[w:{{{1}}}|{{{2}}}]]

rich summit
#

[[w:{{{1}}}|{{{2}}}|<span title="{{{2}}}">{{{1}}}</span>]]

#

Could you try this? in stead?

#

It likely won't work, but to not try... is never knowing

mint violet
#

Huh that's interesting

#

It gives the period's letter as the tooltip upon first mouseover and then switches to the w: interlink in subsequent mouseovers

rich summit
#

Hmmm, So it should be possible then

#

It does indeed with K and D

#

It stays like that in fact

mint violet
#

It does eventually change if you mouseover it enough

#

Weird behavior

rich summit
#

Let's try this one
[[w:{{{1}}}|{{{2}}}|<span title="{{{1}}}"></span>]]

marsh badger
#

I don't think that will work either

#

the span either needs to be on the outside or around the {{{2}}}, I'm not sure which.

rich summit
#

[[w:{{{1}}}|<span title="{{{1}}}">{{{2}}}</span>]]

#

You mean this

marsh badger
#

possibly.

rich summit
#

[[w:Wikipedia|<span title="Wikipedia">Encyclopædia Wikipedia</span>]]

#

If I do this, and I hover over, It shows Wikipedia.
So this should definately work

mint violet
rich summit
#

Yeah.

mint violet
rich summit
#

Thought so, Goody

#

We all learned something today 😉

mint violet
#

The help is very much appreciated.

rich summit
#

I'll put it in my notes

#

You're welcome