I have a combination of headings and nested lists. How do I change the format of list items and headings that are links without changing the non-heading link formatting? I have the following:


I want linkonetext to be in heading 2 format, including heading 2 color, but underlined to show it's a link and blue when you mouse over it. (Currently it shows up in heading 2 format but with link text color and underline.)

I want linktwotext to use the heading 3 color and font size, but underlined to show it's a link and blue when you mouse over it. (Currently I can either have it in a list or have it use heading 3 formatting for the text, but not both, and neither one lets me customize the text color for the link based on what level of the list the link is at.)

I want linkthreetext to be in the default link format including text color and underline.

If I use the standard double-square-bracket markup to generate the links, I don't know what to change in the skin or the .php file so that the correct elements incorporate both the link, the list, and the heading formatting. Once I know where to look, I am happy modifying .css and .php files so that the editors don't need to learn new markup.

You can set your styles in your file pub/css/local.css (if it doesn't exist, create it). For example:

/* links in headings */
h2 a, h3 a { color: black; text-decoration: none; }
h2 a:hover, h3 a:hover { color: blue; text-decoration: underline; }

h3 a and h3 a:hover will be applied if you have the link in a !!!h3 heading.

/* links in first level bulleted lists */
ul > li > a { color: black; text-decoration: none; }
ul > li > a:hover { color: blue; text-decoration: underline; }

/* links in second level bulleted lists */
ul > li > ul > li > a,
ul > li > ul > li > a:hover { color: blue; text-decoration: underline; }

Search for a "CSS tutorial" to learn the basics of styles. It is very powerful way to apply styles to your elements, and you're lucky that today most browsers support it consistently, so you only need to learn and write once (unlike a decade ago). And CSS is fun too. Then you'll more easily/clearly understand WikiStyles (a related, but different beast). --Petko March 27, 2016, at 01:19 PM

How do I prevent pmwiki from automatically changing text into a link. e.g. I want this to appear as text, not a link:

See my the second yellow section on this page for an example:

You can wrap the address in the "escape" characters [@link@] or [=link=]:

How can I open an external link in the SAME window (adding %target=_self% doesn't work)?

You shouldn't need to add anything, normally external links open in the same window. If not, check if you don't have set a custom $UrlLinkFmt variable (which shouldn't contain target='_blank').

  • Interesting. I have an external link set up in the sidebar and when I go to the wiki and click it behaves as you say but after I edit the side bar (don't change anything or even save just click cancel) it then adds the external link icon to the link and opens it in a new window! Refreshing doesn't revert it. The only way to 'reset' it is to enter wiki from the link on another page. Very odd but not overly inconvenient. Weird that the external link icon disappears too. I've done no link variables.
  • Ok now it is really annoying as the behaviour changes not just when editing the sidebar but when entering edit on any page.

Make sure you close the %target=_blank% [[link]] with %% every time, or else all subsequent links in the same paragraph will open in new windows. Also, a skin or a recipe may modify the $UrlLinkFmt variable to force a target=_blank attribute. --Petko April 14, 2009, at 10:36 PM

How can I make a link back to site where I came from (like the button in the browser)?

How do I give a link a Tool Tip? eg [[Links"tool tip"]] or [[Links | here"tool tip"]]

See PITS:00657 and Cookbook:LinkTitles.

How do I use an InputSelection menue as a Link selection. Where do I include the Link-url in the code line?

Hi stan, what are you looking for exactly? Can you give an example. Is Forms or Menus not giving the answer yet? -- SchreyP June 05, 2010, at 05:23 AM

trying ... but want to use inside of a

[[http://somewhere_I_Want_opened_in_a_new_window | Somewhere]] [[%target=_blank% http://somewhere_I_Want_opened_in_a_new_window %%| Somewhere]] Above does not work I know I could just code my own a href's but would rather stick with wonderful wiki codes Ward Christensen

Hi Ward, try %target=_blank% or %newwin% outside the double square brackets, like %newwin% [[http://somewhere_I_Want_opened_in_a_new_window | Somewhere]]%%.
It could be that in Firefox it opens in a new tab, if "Open new windows in a new tab instead" is checked in Menu Tools > Options... under the tab "Tabs" -- SchreyP September 30, 2010, at 03:52 PM

Links with custom parameters?

With include-other-pages, it is possible to specify custom parameters, which can alter the content shown in the included page. Is it possible to do this with links? For example, to have a page which is a template, and the data drawn from page-text-variables elsewhere, based on the parameters specified? -- DougM27 January 13, 2011, at 10:38 AM

I don't know if your template can contain a URL parameter (you'd have to test), but you should at least be able to have your include directive contain one. (This requires Cookbook:HttpVariables.) For example: (:include MyFile MyParm={$?MyParm}:) RandyB February 26, 2011, at 10:55 AM

How do I enter links with round brackets


Use "%28" for "(" and "%29" for ")" Or use Cookbook:FixURL

How do I enter links with double quotes?

 Links with double quotes at the end can be mistaken for image tool tips

Replace double quotes (") with "%22"

All of the links on my pages have the external link icons (i.e. a little square with an arrow point to the upper right, see here for example: behind them? How do I get rid of them?

This happens because for some reason the links are considered external. This often happens when using the static page generator which converts some pages to html links. The simplest way to fix this is to edit local/config.php and place this text in there:

## This changes external links to not have the small link icon in them:
# This is the default:
#$UrlLinkFmt = "<a class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText</a>";
$UrlLinkFmt = "<a class='plainlinks' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText</a>";

This only happens in some skins (monobook?). --Petko June 24, 2012, at 05:02 PM

linked image

[["tool tip title" | Attach: link]]

Attach: link

inline image"tool tip title"
tool tip title

Links with caption

Captions can be added to link standalone pictures by adding a vertical bar (|), see also Images.

[["Paper clips"]] | [- Image 1 -] 

[[http://#dummyaspmwikibroken |"Paper clips"]] | [- Image 2 -]"tool tip title" | Image 3"tool tip title 2" | Image 3

link only (not an inline image):
[["tool tip title 4"]] | [- Image 4-] | Image 1

Paper clips
Image 2
tool tip title
Image 3
tool tip title 2

Image 3

link only (not an inline image): | Image 4

This is a talk page for improving PmWiki.Links.