Community Central
Community Central
Forums: Index Support Requests Link to a specific location on a page without creating headers?
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 4314 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


Hi, I've done many edits and housecleaning and visual improvements to w:c:paradiseislandhd but just a few things I can't work out. I know you can link to any Heading using # - such as [[PageName#HeadingName]] but to create that link you have to create that header which (a) shows on the page, and (b) shows in the TOC.

Isn't there a way to insert a "link here" code to link to without (a) & (b) side effects? Such as linking to a certain row in a table, linking to certain paragraph that doesn't have a paragraph Heading, etc?

Thanks, DarkMoonRising 07:09, June 22, 2012 (UTC)

You can only focus on headings with # because headings have their id attribute match their content. You can focus on any html element with an id by using #idname. So therefore, if you were to have, say:
<div id="foobar">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam at dolor purus. Etiam sagittis tempor cursus. Sed non nisl nec magna ultrices blandit quis vitae nunc. Etiam tristique sagittis lacus, sit amet placerat turpis fermentum quis. Suspendisse mollis lacinia eros, ac interdum sem condimentum ut. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</div>
In an article, you could use a link to focus on it by doing [[Article#foobar]].
Mediawiki makes it very easy to give attributes to tables and table cells, and you probably already know how to do it. For example, {| class="wikitable" There, you're just giving the table a class attribute of "wikitable". You can insert any other attribute in there as well. So {| class="wikitable" id="table_name" will work. You've probably used some style attributes with table cells before as well. For example, |style="background-color:blue;"|content, which will make the cell have a blue background. Just like with the beginning of the table definition, you pass it any html attribute. So |style="background-color:blue;" id="table_row"|content will work. If you have any other questions, ask away. — Matthew2602 (talk) 07:44, June 22, 2012 (UTC)
Ooh - me go experiment :-) DarkMoonRising 07:54, June 22, 2012 (UTC)

Thankyou, so I've been using id= in cells now no problem, but any way to apply an ID to any line? I tried putting <div id="foobar"></div> on a line I wanted to link to, which is in a list, as such:
#<div id="foobar"></div> Point #4 paragraph
but it created a line break after the Point #. Putting <div id="foobar"></div> on its own line between #'s started the # count at 1 again. I worked out a workaround by putting <div id="foobar"></div> at the very end of the previous # point. But is there not a way just to insert an id= anywhere simply?
Ta Dollars_small.pngDarkMoonRising talk contribs | 04:56:44, June 26, 2012.

Yeah. Use a <span> or <p> instead. (<span> should be preferred) Rappy 19:30, June 26, 2012 (UTC)