DokuWiki Links and Images — Internal, External, Interwiki, and Media Embedding
In this tutorial, you'll learn how to create links and embed images in DokuWiki, covering internal page links, external URLs, interwiki shortcuts, email links, anchors, and image embedding with sizing and alignment.
What You'll Learn
- Internal links to wiki pages and namespaces
- External links to websites and URLs
- Interwiki shortcuts (wikipedia, google, etc.)
- Email and link with custom display text
- Image embedding from the media manager and external sources
- Image sizing, alignment, and linking
- Anchor links within a page
Why It Matters
Links are the connective tissue of a wiki. Without links, each page is an isolated document. Internal links create the navigation structure that makes a wiki useful. External links connect your documentation to resources on the web. Images make pages visual and engaging. Getting the syntax right ensures links work and images display correctly.
Real-World Use
A developer documents a deployment Process. They use internal links to connect the deployment page to related pages (server setup, configuration, rollback procedures). They embed a screenshot of the deployment dashboard using the image syntax with a thumbnail size. They link to the official Docker documentation using an interwiki shortcut. The result is a well-connected, visual documentation page that serves as a single source of truth for the team.
Learning Path
flowchart LR A[Syntax] --> B[Links and Images] B --> C[Tables] C --> D[Media Management] D --> E[Sidebar] E --> F[Namespaces]
Internal Links
Internal links point to other pages within your DokuWiki.
Basic Internal Link
[[page]]
This creates a link to the page with ID page. The displayed text is the page name.
Link with Custom Text
[[page|Display Text]]
The pipe character separates the target from the display text. The link text can be anything you want.
Link to a Page in Another Namespace
[[namespace:page]]
[[projects:roadmap|Project Roadmap]]
The colon separates the namespace from the page name.
Link to the Start Page of a Namespace
[[namespace:]]
A colon at the end links to the start page of that namespace.
Link to an External URL
[[http://example.com]]
[[http://example.com|Example Website]]
External links open in a new window by default. DokuWiki adds an external link icon automatically.
Link with a Title Attribute
[[page|Display Text|title="Hover text"]]
The title attribute appears when the user hovers over the link.
Links to Sections
You can link to a specific section within a page:
[[page#Section Heading]]
DokuWiki automatically generates section anchors from heading text. Spaces in the heading become underscores in the anchor.
Interwiki Links
Interwiki links are shortcuts for linking to external sites. DokuWiki comes with predefined shortcuts for Wikipedia, Google, and other sites:
[[wp>DokuWiki]] # Links to Wikipedia article
[[google>DokuWiki]] # Links to Google search
[[php>function.echo]] # Links to PHP documentation
The format is [[shortcut>term]]. The shortcut is defined in conf/interwiki.conf, and you can add your own.
Email Links
[[admin@example.com]]
[[admin@example.com|Email the admin]]
DokuWiki obfuscates email addresses in the HTML to prevent spam bots from harvesting them.
Embedding Images
Basic Image
{{:image.png}}
The colon before the filename indicates the root namespace. The image file must exist in data/media/.
Image from a Namespace
{{namespace:image.png}}
Image with Alternate Text
{{:image.png|Alternate text}}
The alternate text is used by screen readers and displayed if the image does not load.
Image Sizing
{{:image.png?200}} # Width 200 pixels
{{:image.png?200x150}} # Width 200, height 150
{{:image.png?200|Caption}} # Width 200 with caption
The question mark introduces size parameters. If you specify only one dimension, DokuWiki maintains the aspect ratio.
Image Alignment
{{ :image.png}} # Left aligned (space before)
{{:image.png }} # Right aligned (space after)
{{ :image.png }} # Center aligned (spaces both sides)
Spacing around the image syntax controls alignment.
Image as a Link
[[http://example.com|{{:image.png}}]]
Wrap an image inside a link to make it clickable. Clicking the image navigates to the link target.
External Images
{{https://example.com/image.png}}
You can embed images from external URLs. DokuWiki fetches and caches them.
Link and Image Quick Reference
| Purpose | Syntax |
|---------|--------|
| Internal page | [[page]] |
| With custom text | [[page|Show this]] |
| External URL | [[http://example.com]] |
| Interwiki | [[wp>DokuWiki]] |
| Email | [[admin@example.com]] |
| Image | {{:image.png}} |
| Sized image | {{:image.png?200}} |
| Image + link | [[url\|{{:image.png}}]] |
| Right-aligned | {{:image.png }} |
| Center-aligned | {{ :image.png }} |
Advanced Link Features
Linking to a Non-Existent Page
When you link to a page that does not exist, DokuWiki renders it as a "broken" link (red or with a question-mark icon). Clicking it opens the page creation form. This is intentional — it encourages users to create missing pages.
No-Follow Links
By default, external links in DokuWiki have rel="nofollow" to discourage spam. You can disable this in Configuration Manager.
Link Targets
By default, external links open in a new window. You can change this in the template settings.
Common Mistakes
- Forgetting the colon for root images:
{{image.png}}(without colon) links to the current namespace.{{:image.png}}(with colon) links to the root. When your page is in a namespace, these point to different files. - Using backslashes instead of pipes: In Markdown, links use
[text](url). In DokuWiki, they use[[url|text]]. The pipe character separates URL from text. - Missing underscores or hyphens in page IDs: Links to pages with spaces in the name will not work because page IDs cannot contain spaces. Use hyphens in both the page ID and the link target.
- Linking to full URLs for internal pages: Use page IDs for internal links, not full URLs.
[[start]]is correct;[[http://yourserver/wiki/start]]is wrong and will reload the entire page. - Embedding images without checking permissions: If image uploads are restricted, the embedded image will show as a broken link. Verify the file exists and is accessible.
Practice Questions
- How do you link to a page in a different namespace with custom display text? Provide the exact syntax.
- What is the difference between
{{:image.png}}and{{image.png}}when used on a page inside a namespace? - How do you embed a 300-pixel-wide image that is centered and linked to an external URL?
- Challenge: Create a wiki page that serves as a "link hub" containing: three internal links to pages in different namespaces, two external links to documentation sites, one interwiki link to Wikipedia, one email link, one embedded image (your choice, resized to 400px wide and right-aligned), and one clickable image that links to an external site. The page should have a table of contents generated from headings.
FAQ
Mini Project
Goal: Create a linked resource page with images.
- Create a page called
resourcesin your wiki - Add sections for "Documentation," "Tools," and "Team"
- Under "Documentation," add internal links to three pages in your wiki
- Under "Tools," add external links to three tools your team uses
- Under "Team," add internal links to team member pages
- Embed a logo or header image at the top of the page (resized to 200px)
- Make the header image link back to the start page
- Add interwiki links to Wikipedia for technical terms mentioned on the page
What's Next
Links connect your pages. Now learn to create tables and advanced formatting to present structured data.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro