DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:embed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:embed [2009-10-21 10:41] 194.167.50.193plugin:embed [2024-02-02 08:05] (current) Aleksandr
Line 1: Line 1:
-====== DokuWiki Plugin: embed ======+====== Embed Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: This plugin allows to embed wikipages seamlessly into another page. In addition, parts marked with the label plugin can be replaced.+description: This plugin allows to embed wikipages seamlessly into another page. In addition, parts marked with the Label Plugin can be replaced.
 author     : Pascal Bihler author     : Pascal Bihler
 email      : bihler@iai.uni-bonn.de email      : bihler@iai.uni-bonn.de
Line 12: Line 12:
 similar    : include similar    : include
 tags       : include, embed tags       : include, embed
 +
 +downloadurl: http://pb.wh4f.de/dokuwiki/embed.zip
 ---- ----
- 
- 
- 
  
 ===== The idea ===== ===== The idea =====
  
 Sometimes you are required to include a wikipage while replacing parts of it, e.g. if building up hierarchical menus with the [[:Template#sidebar|Sidebar Template]]. Sometimes you are required to include a wikipage while replacing parts of it, e.g. if building up hierarchical menus with the [[:Template#sidebar|Sidebar Template]].
- 
- 
  
 ===== Requirements ===== ===== Requirements =====
  
 I've developed the plugin under the DokuWiki version of 2006-11-06 and seems to work with version 2007-06-26 as well. I've developed the plugin under the DokuWiki version of 2006-11-06 and seems to work with version 2007-06-26 as well.
- 
- 
  
 ===== Download / Installation ===== ===== Download / Installation =====
Line 35: Line 30:
 ===== Shortcomings ===== ===== Shortcomings =====
  
-To assure proper use of ACLs, this plugin inhibits caching on pages which make use of the <embed ...> tag.+To assure proper use of [[:acl|ACLs]], this plugin inhibits caching on pages which make use of the ''%%<embed ...>%%'' tag.
  
 ===== Syntax ===== ===== Syntax =====
Line 50: Line 45:
 </embed> </embed>
 </code> </code>
- 
  
 ===== Use Case ===== ===== Use Case =====
Line 113: Line 107:
       * [[.:labs:]]       * [[.:labs:]]
     * [[:publications:]]     * [[:publications:]]
- 
- 
  
 ===== Code ===== ===== Code =====
Line 161: Line 153:
  'name'   => 'Embed',  'name'   => 'Embed',
  'desc'   => 'Allows to embed wikipages in other ones, while offering the possibility to replace parts of the original page marked with labels.',  'desc'   => 'Allows to embed wikipages in other ones, while offering the possibility to replace parts of the original page marked with labels.',
- 'url'    => 'http://www.dokuwiki.org/plugin:embed',+ 'url'    => 'https://www.dokuwiki.org/plugin:embed',
  );  );
  }  }
Line 213: Line 205:
  
  // avoid circular references  // avoid circular references
- if (! (array_search($id,$embedded_pages_by_plugin_embed) === false)) + if (in_array($id,$embedded_pages_by_plugin_embed)) 
- return false;+ return false;
  
  array_push($embedded_pages_by_plugin_embed,$id);  array_push($embedded_pages_by_plugin_embed,$id);
Line 292: Line 284:
  
  //check if interwiki or email:  //check if interwiki or email:
- if ((! strpos('>',$link) === false|| (! strpos('@',$link) === false))+ if (strpos('>',$link) !== false || strpos('@',$link) !== false)
  return $link;  return $link;
  
Line 352: Line 344:
  
 >>>I started with this plugin, but since it works not on the text, but on the node representation of wikisource, the substitution of elements (via label) was incompatible with the list rendering (and therefore not acceptable) >>>I started with this plugin, but since it works not on the text, but on the node representation of wikisource, the substitution of elements (via label) was incompatible with the list rendering (and therefore not acceptable)
 +
 +Embeds with absolute internal links go wrong; they come out as ns:ns:page instead of just ns:page.
 +fixed by change line 184 from 
 +  } elseif (strpos($link, ':') === false){
 +to
 +  } elseif (strpos($link, ':')){
 +  
 +===== Stopped working =====
 +
 +I wanted to make a "dynamic mediawiki style infobox" and this was the best plugin for it, until a day it stopped working.
plugin/embed.1256114476.txt.gz · Last modified: 2009-10-21 10:41 by 194.167.50.193

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki