Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Wiki like links to mywiki articles

ChiOneChiOne New
edited October 2007 in Vanilla 1.0 Help
I want to make links to wiki articles in easy way I want an ability to write something like this [[articlename|article]] or this [[articlename]] and get it converted to something like this: <a href="http://www.mywiki.org/articlename" > article </a> Want the ability to change Path to mywiki in settings of this extension. So i would have an ability to integrate any wiki in my vanilla or even better several wikies. [[w1|article]] [[w2|artiсle]] ... Maybe someone mastered can make this very useful extension in 20 minutes, may be it will be just some changes in bbcode extensions. Or maybe its harder than i think?

Comments

  • Options
    edited October 2007
    I believe you can get this working with the Transmogrifier extension. Just configure the Transmogrifier to to replace the the text "[w1|article]" or whatever with the appropriate link.

    The one issue here is you have to manually program the Transmogrifier for every article. It won't automatically parse the syntax.

    If you want it to do that, I think you'll need to write a new extension... Which may not be so hard. You might be able to make a few quick modifications to one of the parsing extensions... I don't know, maybe. Things are rarely as easy as you hope.
  • Options
    edited October 2007
    Now that I think about it, here's another idea that would probably work if you're using a parser extension.

    You could probably create a custom tag and that mimics the "url"/"a href" tag, but adds the static wiki address to the start of the article name. I use ForcedBBCode, and I think adding something like the following to the BBCodeParser.php file would work (note the following isn't tested):

    'url' => array( 'htmlopen' => 'a', 'htmlclose' => 'a', 'allowed' => 'none^img', 'attributes'=> array('url' => 'href=%2$s%1$s%2$s', 't' => 'target=%2$s%1$s%2$s')), 'wiki_link' => array( 'htmlopen' => 'a', 'htmlclose' => 'a', 'allowed' => 'none^img', 'attributes'=> array('wiki_link' => 'href="http://www.mywebsite.com/wiki/%2$s%1$s%2$s', 't' => 'target=%2$s%1$s%2$s')),

    That would allow you to write something like "[wiki_link]article-name[/wiki_link]", and "article-name" would automatically link to "www.mywebsite.com/wiki/article-name" (this would require that you use permalinks on the wiki). Alternatively, you could also write "[wiki_link=article-name]a bunch of text[/wiki_link]" with predictable results. You could then add the tag to your text formatter bar, if you're using one, and automate all this.
This discussion has been closed.