+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 11

Thread: embed internal link in HTML

  1. #1
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    embed internal link in HTML

    Hi,
    May I know how I can embed wiki internal link into HTML code(actually, it is still PHP code, but the HTML section.).

    Also, in html, if I want the users to open a new window after clicking the link, I just define "target" attribute in the link tag. But how can I let the user open new window after click an internal wiki link?

    Actually, the "Editing Help" under "summary" input field on "Edit" page is a good example. But which file should I go for that part of code check?

    Thanks!
    Last edited by sunnyday09; June 25th, 2009 at 15:56.

  2. #2
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    Solved the problem for opening new window for external link by changing the code in linker.php. But for internal link, still no luck.

    Also, any guidance for putting a internal link in html?
    Part of the code is:
    ------------------------
    "document.write(\"<p>For categories, please click here for "."[[Categories | list of all categories]]"."</p>\");\n";
    ------------------------

    Is it the correct way to embed internal link?

    Many thanks!

  3. #3
    Super Moderator Michael Daly will become famous soon enough Michael Daly will become famous soon enough Michael Daly's Avatar
    Join Date
    May 2006
    Location
    Homeless and OTR, Canada
    Posts
    4,417
    Rep Power
    9

    If you're using JavaScript after the page has loaded, then the parser will not handle the wikitext. You'll have to specify the link as a URL.
    Private message are for private information. Please post public questions. Thanks

  4. #4
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    Yes. I got the problem! Thanks!

    May I know how to open a new window from an internal link?

  5. #5
    Super Moderator Michael Daly will become famous soon enough Michael Daly will become famous soon enough Michael Daly's Avatar
    Join Date
    May 2006
    Location
    Homeless and OTR, Canada
    Posts
    4,417
    Rep Power
    9

    Look up target for links in HTML. Also, there have been a couple of questions on this on these forums recently.
    Private message are for private information. Please post public questions. Thanks

  6. #6
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    You are right!

    I can simply use <a target="_blank" href="XXXX">test</a> to solve open the new window problem. But I'm a little confused. If I need to link to "Categories" page, and I have to use url instead of using wiki text. for "XXXX" part, do I have to change this url from my local url to development server url and then to production server url in different environment or there is more efficient way to put the url for the code of "XXXX"?

    Thanks!

  7. #7
    Super Moderator Michael Daly will become famous soon enough Michael Daly will become famous soon enough Michael Daly's Avatar
    Join Date
    May 2006
    Location
    Homeless and OTR, Canada
    Posts
    4,417
    Rep Power
    9

    If you use relative URLs instead of absolute, you could move from dev to prod directly.
    Private message are for private information. Please post public questions. Thanks

  8. #8
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    I guess I was asking a stupid question. I should have got the answer myself.

    Thanks!

  9. #9
    Senior Member sunnyday09 is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    101
    Rep Power
    1

    I just realized that I had not got my original question answered completely yet.

    Then come back to my original question:
    How can I open new window from an internal "wikitext" link? Now I found that I could be able to open a new window if the internal link is an html link. But if it is wikitext link, how can I do that?

    Thanks!

  10. #10
    Super Moderator Michael Daly will become famous soon enough Michael Daly will become famous soon enough Michael Daly's Avatar
    Join Date
    May 2006
    Location
    Homeless and OTR, Canada
    Posts
    4,417
    Rep Power
    9

    I thought you were going to use JS to insert the link - in that case, just insert the HTML with target. Alternatively, if you use JS to process the page after all wiki processing is done and you want to have all internal links open in another page, then use JS to rewrite every URL with target.

    If you're not using JS, then you'd have to write an extension to handle this, if no such extension currently exists. You should search these forums for target - I know this has been asked before and perhaps someone has posted a shortcut for this.
    Private message are for private information. Please post public questions. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Adding html, internal links, and categories with a hook
    By carnal in forum Customizing MediaWiki
    Replies: 0
    Last Post: May 9th, 2009, 17:11
  2. How do I make an internal image link to an outside URL?
    By Cooknn in forum MediaWiki General Discussion
    Replies: 4
    Last Post: April 5th, 2009, 23:13
  3. Image as internal link
    By booneman2000 in forum Customizing MediaWiki
    Replies: 1
    Last Post: December 28th, 2008, 22:47
  4. Embed Category Link
    By eddron in forum WikiCode Formatting
    Replies: 1
    Last Post: February 4th, 2008, 23:35
  5. link to internal page with arguments
    By pvn in forum WikiCode Formatting
    Replies: 3
    Last Post: April 16th, 2006, 21:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts