Simple internal linking with #anchor using Textile Editor

Phratzz
Phratzz
edited December 2016 in Campaign Portal Building

Hello

I was wondering if there was a simple way to write links with #anchor for anchor links

i'm using the Textile Editor, since the CkEditor is clunky, i know you can easily make them in that.

Currently i use [[ Link | Text ]] to write internal wiki links, this is all well and good but for some pages i need to use anchor links such ash /wiki/cities#name as an example, i currently write them as normal links, however they show up as off-site links with different styling, is there a way to write something link [[ Link | #anchor | Text ]] to solve this?

Post edited by Phratzz on

Comments

  • cgregory
    cgregory
    Posts: 780

    You can look at @UselessTriviaMan Ptolus Campaign he setup some anchors there.

    Basically, you can create the anchors like this throughout your text where you want the anchors to jump to.


    <a class="anchor" name="Ptop"></a>

    <a class="anchor" name="P1"></a>

    <a class="anchor" name="P2"></a>

    And then create your clickable links like this.


    <p><strong><a href="#P1">1</a> <a href="#P2">2</a> <a href="#P3">3</a> <a href="#P4">4</a>

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Phratzz
    Phratzz
    Posts: 8

    Yes i do that currently by making normal links, but i need to link to another page and was wondering if i can do that somehow using built in link expressions?

    i currently write my links as

    [[classes | Classes]] for normal internal links

    "Classes":/wikis/classes#Fighter for anchor links

    The first way gives the link the class "wiki-page-link" since it's an internal link, however the secound way doesn't, i can manually give the link by writing the <a> tag manually but that defeats the purpose of having link expressions

  • cgregory
    cgregory
    Posts: 780

    I see what you want. You are trying to create a CSS following wikipedia's coloring coding for links and the class of anchor links vs wiki links is causing the style to be different.

    Short answer is there is no easy way I know of to change the class of the anchor link to a wiki-page-link class. That being said you could look at modifying a subset of the external-link class to mimic the wiki-page-link class

    a[href*="#"]

    { color: set to whatever your wiki-page-link class is set to;

    }

     

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Phratzz
    Phratzz
    Posts: 8 edited December 2016

    Okay, that's what i thought, just wanted to make sure i wasn't missing anything.

    Then i'm just gonna check for internal links via css instead using something like this.



    a[href*="/cl.obsidianportal.com"],
    a[href^="cl.obsidianportal.com"],
    a[href^="/"] {
    /* Normal internal link styling */
    }

     

    Post edited by Phratzz on
  • cgregory
    cgregory
    Posts: 780

    Yeah, great idea.

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

Sign In or Register to comment.

April 2024
Season of Strife

Read the feature post on the blog
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