Skip to content

Commit

Permalink
Display internal links instead of linkto close #457
Browse files Browse the repository at this point in the history
+ updated manual
  • Loading branch information
vincent-peugnet committed Nov 1, 2024
1 parent 7570a22 commit 16548db
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,15 @@ You can use an existing [bookmark](#bookmarks) as filter and sorting preset. For

It is even possible to combine bookmark and filters! Specific filters and sorting will overide bookmark settings.

##### Linkto in templates
##### Backlinks

A specific case exist when if you want to use the [linkto](#linkto) filter in templates: If you want to list all the pages that point to the current page, you can use the wildcard character `*` as a value.
A specific case exist when if you want to use the [internal links](#linkto) filter in templates: Let's say you want to list all the pages that point to the current page. This is a traditionnal wiki feature called [backlinks](https://en.wikipedia.org/wiki/Backlink#Wikis).

If you want to do this, you can use the wildcard character `*` as a value of `linkto` parameter.

%LIST?linkto=*%

It will be replaced by the [id](#page-id) of the currently displayed page.



Expand Down Expand Up @@ -431,12 +434,16 @@ You can use an existing [bookmark](#bookmarks) as filter and sorting preset. For

It is even possible to combine bookmark and filters! Specific filters and sorting will overide bookmark settings.

##### Linkto in templates
##### Using internal link filter in templates

Just like the [backlinks](#backlinks) strategy, it's possible use the internal links filter in template for this specific use case: A template that have a link pointing to a random page, which is linking to the current one.

A specific case exist when if you want to use the [linkto](#linkto) filter in templates: If you want to create a selection of all the pages that point to the current page, you can use the wildcard character `*` as a value.
If you want to do this, you can use the wildcard character `*` as a value of `linkto` parameter.

%RANDOM?linkto=*%

It will be replaced by the [id](#page-id) of the currently displayed page.



#### Media list
Expand Down Expand Up @@ -946,7 +953,7 @@ List of [users](#user-levels) that have edited the page, or that can do it. You

*read only*

It's a list of all pages that are linked from the current page. This is analysed when the page is rendered.
It's a list of all internal links contained by a page. A link is considered internal if it point to anoter page of your W. This is analysed when the page is rendered. This metadata is also used to display the page graph in the home view.

##### Visitcount

Expand Down
2 changes: 1 addition & 1 deletion app/class/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class Model
'tag' => 'tag',
'title' => 'title',
'description' => 'description',
'linkto' => 'linkto',
'linkto' => 'internal links',
'geolocalisation' => 'geolocalisation',
'datemodif' => 'modification date',
'datecreation' => 'creation date',
Expand Down
2 changes: 1 addition & 1 deletion app/view/templates/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<?php endif ?>
<?php if ($columns['linkto']) : ?>
<th class="linkto">
<a href="<?= $opt->sortbyorder('linkto') ?>">linkto</a>
<a href="<?= $opt->sortbyorder('linkto') ?>">internal links</a>
<?= $this->insert('macro_tablesort', ['opt' => $opt, 'th' => 'linkto']) ?>
</th>
<?php endif ?>
Expand Down
4 changes: 2 additions & 2 deletions app/view/templates/homeopt.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
</fieldset>

<fieldset class="flexcol" data-default="<?= $opt->isdefault('linkto') ? '1' : '0' ?>">
<legend>Link to</legend>
<legend>Internal links</legend>
<p class="field">
<label for="linkto" title="filter pages that have links pointing to the following selected page">Link pointing to</label>
<label for="linkto" title="filter pages that have links pointing to the following selected page">page have a link to...</label>
<select name="linkto" id="linkto">
<option value="" selected>-- not set --</option>
<?php
Expand Down

0 comments on commit 16548db

Please sign in to comment.