Creating Ancor points

Keryth987
Keryth987

I dont even know if this is possible in Textile, but I have numerous tidbits of information tha tI would like to reference in Journal posts and such, that do not have their own pages, but are on a page with several other pieces of information.

What i'd like to do is be able to create a reference point of some kind, say for a specific NPC, tha tI could then reference, similar to how wiki pages, items, and character entries are referenced now.

Comments

  • thaen
    thaen
    Posts: 664

    Totally possible.  You just need to put ids on the parts you want to jump to, and then use "#<id>" on the end of the url to jump to it.

    So say you want to jump to the "City Themes" section of this page:

    https://shadows-over-new-york.obsidianportal.com/wikis/city

    You would take the City Themes portion of html:

    <div class="TitleImage" style="position:absolute;left:90px;top:5px;">

    and change it to:

    <div class="TitleImage" style="position:absolute;left:90px;top:5px;" id="city_themes">

    Then on the other page where you wanted to link from, you would create the url with textile as:

    "City Themes":/wikis/city#city_themes

    Let me know if that doesn't make sense or if you run into any issues.

    Obsidian Portal Developer

  • ragnarhawk
    Posts: 123

    I helped a friend get this set up in one of their campaigns.

    This map has some temples on it, which then have links back to the Deities page: https://rasworld.obsidianportal.com/maps/124529

    For example, marker 7 links to an anchor in the deities page.

  • thaen
    thaen
    Posts: 664

    @ragnarhawk ... awesome!  Your example points out that you can also use "name" instead of "id".

    Just in case it confuses anything, it looks like there's an extra "t" in the url on that marker 7, and so it won't actually jump to anything. 

    https://rasworld.obsidianportal.com/wikis/pantheon-of-the-gods#tIluma

    vs

    https://rasworld.obsidianportal.com/wikis/pantheon-of-the-gods#Iluma

     

    Obsidian Portal Developer

  • ragnarhawk
    Posts: 123

    @thaen, glad to help.  Also - thank you.  The link is now corrected on the map

  • twiggyleaf
    twiggyleaf
    Posts: 1,806

    smiley

    "I met a traveller from an antique land....."

    CotM May 2016: Mysteria: set in Wolfgang Baur’s MIDGARD.

    Previous CotM Aug 2012: Shimring: High Level Multiplanar Campaign

    Inner Council Member

  • thaen
    thaen
    Posts: 664

    @ragnarhawk, looks great!

    Obsidian Portal Developer

  • ragnarhawk
    Posts: 123

    @thaen, Thank you.

    Unfortunately, there does not seem to be a way to make it work in reverse...  It would be really nice if we could link from a wiki article to an anchor of some sort on a map

  • Keryth987
    Keryth987
    Posts: 940

    @Thaen Thanks for that, however, the things i want to use Anchors for aren't in Divs


    [accordion]
    [accordion-item] [title] [[File:1160301 | class=media-item-align-center | 500x74px | Organizations_of_Note.png]][end-title]
    [content] [[File:1156822 | class=media-item-align-none | The_HArpers.jpg]]
    [content][[File:1158236 | class=media-item-align-none | The_Zhentarim.jpg]]
    [content][[File:1159461 | class=media-item-align-none | Kinghts_of_the_Round_Table.jpg]]
    [content][[File:1165160 | class=media-item-align-none | The_Jedi.jpg]]
    [content][[File:1165276 | class=media-item-align-none | Knights_of_the_Shield.jpg]]
    [end-content][end-accordion-item]

    I need to create an ID/Anchor for each Accordion item/image

  • ragnarhawk
    Posts: 123 edited April 12

    Hi @Keryth987,

    I didn't use divs for my anchors, just embedded them in table items.

    This, for instance, is what I had for the link above:

    <td><a name="Iluma" style= "position: absolute;   transform: translateY(-10vh);" ></a>Iluma</td>

    So the link itself is essentially invisible.  The positioning was added to shift the link down the page slightly, as I found that it was sometimes not entirely visible if it was right at the top of the page.

    Post edited by ragnarhawk on
  • thaen
    thaen
    Posts: 664

    @ragnarhawk, cool idea to link back to a map marker!  I've noted that feature request down in the dev list.

    Obsidian Portal Developer

  • thaen
    thaen
    Posts: 664

    @Keryth987, as ragnarhawk noted, it doesn't have to be a div, it could be any html element, and you would just add an "id" to it.  But div is often easiest to use because you can wrap a div around anything, and it generally doesn't change the look of that thing ... so you could do:

    <div id="the-harpers">

    [[File:1156822  | class=media-item-align-none | The_HArpers.jpg]]

    </div>

    BUT, the issue you're going to run into is that the "jump to anchor" only works if the item is not hidden.  Since these are in an accordion, they are hidden when the page first loads, so the "jump to" doesn't see anything to jump to, and won't jump.

    Other options ...

    1) You could wrap the entire accordion in a div with an id, and then you would be jumping to the accordion.  It would still be collapsed though, so the visitor would have to click to open it and then look for the image they wanted.

    2) You could remove the accordion and just have the images directly visible in the page, and then wrap each image in a div with an id (as above).

    3) You could creat a new page with just those images on it and wrap each one in a div with an id, and have that be where the visitor jumps to.  Then on the original page, instead of having the accordion with the image as the "title", you would make that image a link to the new page.  And maybe put a link at the top of the new page to jump back to the "title" image on the original page.

    Hope one of those helps with the effect you're trying to achieve.

     

    Obsidian Portal Developer

  • UselessTriviaMan
    UselessTriviaMan
    Posts: 532

    Yeah, I use anchors all over the place in my wiki too. I hadn't realized that accordions wouldn't play well with anchors though, so I'm glad you brought this up. 


    Ptolus, City by the Spire - 2016 Campaign of the Year

    "Please pay attention very carefully, because this is the truest thing a stranger will ever say to you: In the face of such hopelessness as our eventual, unavoidable death, there is little sense in not at least TRYING to accomplish all your wildest dreams in life."  - - Kevin Smith

  • thaen
    thaen
    Posts: 664

    I wasn't sure if it would work or not, but I tested it out to make sure Keryth wasn't going to run into any other surprises, and it wouldn't jump for my test.  So at least it didn't work for the test I was trying.

    Obsidian Portal Developer

  • Keryth987
    Keryth987
    Posts: 940

    I SUPPOSE I can just copy the NPCs to the default character page, not tha tI plan on utilizing that except for players to enter and update their Character Sheets.

  • DungeonMasterLoki
    DungeonMasterLoki
    Posts: 321

    Nice, so anchor points basically work just like in html. Good, I'll be adding them on my next edit pass on the Campaign Hub! Merci! 

    Planejammer Panopticon: Central Hub for the Planejammer Campaign Series

    Current Active Games: Planejammer: Catch My Drift! (Starfinder)  | Planejammer: The Spelljoined (Pathfinder 1e) Campaign of the Year 2011 | Planejammer: Beyond The Sky (Pathfinder 1e)

Sign In or Register to comment.

Campaign of the Month
October 2021

Hogwarts and the Magic of the Founders


Read the feature post on the blog!
Or return to Obsidian Portal!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions