You are here

included-filters.html in Freelinking 4.0.x

Same filename and directory in other branches
  1. 8.3 help/included-filters.html
  2. 7.3 help/included-filters.html

File

help/included-filters.html
View source
<p>A number of ready-to-use filters are included in the <strong>Freelinking</strong> framework (e.g. Nodetitle. Nid, User,
Google search, Drupal search, Drupal projects, Wikipedia, etc.).
This help file describes the purpose of the included filters and how to use them.</p>

<p>The <strong>Freelinking</strong> link format is:</p>

<code>[[indicator:target|title|tooltip|arg1|arg2|…]]</code>

<p>Everything <em>except</em> the target is optional. If you do not
specify an indicator the default configured for the text format will be used.
See the page <em>Administration » Configuration » Content authoring »
Text formats and editors</em>.</p>

<p>The <mark>indicator</mark> is used to select which filter to use.</p>

<p>There are three built-in filters (Nowiki, Showtext, Redact) These
filters will not generate links. In addition to these, the project includes a
small set of optional plugin filters, which you may enable specifically on a
text format as desired.</p>

<p>Below is an overview of all the filters which are included in the project:</p>

<h4>Nowiki (built-in)</h4>

<p>This filter will strip the nowiki-indicator and will preserve the rest of
the text, including the double brackets, verbatim.</p>

<p>Example:<br/>
<code>[[nowiki:this is not a freelink]]</code><br/>
becomes:<br/>
<code>[[this is not a freelink]]</code></p>

<h4>Showtext (built-in)</h4>

<p>This filter is similar to the Nowiki filter, however, will also strip double brackets before
showing the text.</p>

<p>Example:<br/>
<code>[[showtext:this is not a freelink]]</code><br/>
becomes:<br/>
<code>this is not a freelink</code></p>

<h4>Redact (built-in)</h4>

<p>This filter works like the Showtext filter for logged in users, however, will
redact/conceal marked up content from the page before showing the text to the
anonymous user.</p>

<p>Example:<br/>
<code>[[redact:sensitive stuff]]</code><br/>
becomes:<br/>
<code>sensitive stuff</code><br/>
for logged in users, and<br/>
<code>******</code><br/>
for anonymous users.</p>

<h4>Node title</h4>

<p>The Node title plugin allows users to create links based on the title of a
node. You may restrict the plugin to a subset of content types, but by default
all node types are allowed. Note that users without access to the node will be
unable to see the link.</p>

<p>Example:<br/>
<code>[[nodetitle:First page]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-nodetitle freelink-internal" title="Click to view a local node." href="/node/1">test&lt;/a&gt;</code></p>

<div class="message warning">Note: If you have two nodes with the same title,
it will not be possible to know which node to link to. If you change the title
of the page linked to.  If you change the title of the page
linked to, the freelink will no longer work.</div>

<h5>Concept: Fallback</h5>

<p>This plugin also introduces the concept of a “fallback”. A fallback is an
option that will be used when the target cannot be found. A fallback may also be
to use a different plugin. The following options are allowed to be used as
fallbacks for the Node title plugin:</p>

<ul>
  <li>Do nothing</li>
  <li>Show text without markup</li>
  <li>Add a link to create the node (Wiki-style)</li>
  <li>Add a link to search content - Search </li>
  <li>Add an error message</li>
</ul>

<h4>Node nid</h4>

<p>Allows to link to a node for when a user knows the node entity id.</p>

<p>Example:<br/>
<code>[[nid:2]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-nid freelink-internal" title="Click to view a local node." href="/node/2">First page&lt;/a&gt;</code></p>

<h4>User profile</h4>

<p>Allows to link to a user by user entity id.</p>

<p>Example:<br/>
<code>[[user:1]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-user freelink-internal" title="Click to view a user profile." href="/user/1">admin&lt;/a&gt;</code></p>

<p>Example:<br/>
<code>[[user:admin]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-user freelink-internal" title="Click to view a user profile." href="/user/1">admin&lt;/a&gt;</code></p>

<h4>Path</h4>

<p>Allows directly linking to a path by a relative path.</p>

<p>Example:<br/>
<code>[[path:/breaking-news]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-path freelink-internal" title="Click to view a local node." href="/breaking-news">Breaking news&lt;/a&gt;</code></p>

<h4>File</h4>

<p>Allows linking to a file by file name. The plugin must be configured with the
file system scheme to use e.g. public or private.</p>

<p>Example:<br/>
<code>[[file:logo.png]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-file freelink-internal" title="Click to view a local file." href="http://<siteroot>/sites/default/files/logo.png">logo.png&lt;/a&gt;</code></p>

<h4>Search - <code>freelinking_search.inc</code></h4>

<p>Example:<br/>
<code>[[search:test]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-search freelink-internal" title="Search this site for contents like “test”." href="/search/node/test">test&lt;/a&gt;</code></p>

<h4>External links</h4>

<p>Allows linking to an external page by absolute url.</p>

<p>Example:<br/>
<code>[[https://groups.drupal.org/frontpage]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-external" title="Click to visit an external secure URL." href="https://groups.drupal.org/frontpage">https://groups.drupal.org/frontpage&lt;/a&gt;</code></p>

<p>You may configure <strong>Freelinking</strong> to poll the URL for
title and availability, but this may lead to slow page loads.</p>

<p>Example:<br/>
<code>[[google:drupal]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-google freelink-external" title="Search Google for contents like “drupal”." href="http://www.google.com/search?q=drupal&hl=en">Google Search "drupal"&lt;/a&gt;</code></p>

<h4>Drupal.org</h4>

<p>Use the short name of the project as the target.  You may configure
<strong>Freelinking</strong> to poll the URL for title and
availability, but this may lead to slow page loads.</p>

<p>Example:<br/>
<code>[[drupalproject:freelinking]]</code><br>
becomes:<br/>
<code>&lt;a class="freelink freelink-drupalproject freelink-external" title="Click to view project Drupal.org." href="http://drupal.org/project/freelinking">Drupal.org: “freelinking”&lt;/a&gt;</code></p>

<p>Use the Drupal.org nid as the the target.  You may configure
<strong>Freelinking</strong> to poll the URL for title and
availability, but this may lead to slow page loads.</p>

<p>Example:<br/>
<code>[[drupalorg:1]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-drupalorgnid freelink-external" title="Click to view node on Drupal.org." href="http://drupal.org/node/1"&gt;Drupal.org: “#1”&lt;/a&gt;</code></p>


<h4>Wikipedia, etc...</h4>

<p>The indicators supported by this plugin are: wikibooks, wikipedia,
wikinews, wikiquote, wikisource and wiktionary.</p>

<p>Example:<br/>
<code>[[wikipedia:Main Page]]</code><br/>
becomes:<br/>
<code>&lt;a class="freelink freelink-wikipedia freelink-external" title="Click to visit a wikipedia page." href="http://en.wikipedia.org/wiki/Main_Page"&gt;Main_Page&lt;/a&gt;</code></p>