DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:include

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:include [2017-04-07 09:28] 93.81.210.107plugin:include [2024-03-13 18:21] (current) 91.89.222.218
Line 6: Line 6:
 email      : freaks@dokuwiki.org email      : freaks@dokuwiki.org
 type       : syntax, helper type       : syntax, helper
-lastupdate : 2015-06-13 +lastupdate : 2023-09-22 
-compatible : 2016-06-26, Detritus, HrunBinkyWeatherwaxAnguaAdora BellePonder Stibbons+compatible : GreeboFrusterick MannersHogfatherIgorJack JackrumKaos
 depends    : tag depends    : tag
-conflicts  : mediasyntax +conflicts  : mediasyntax, PhotoGallery 
-similar    : +similar    : wst
 tags       : include, embed tags       : include, embed
  
Line 19: Line 19:
 ---- ----
  
-This is a handy [[plugins|plugin]] with which you can include another wiki page into the current one. Just including certain sections of a page or even whole namespaces is supported, too.+:!: The 2018-11-29 release fixes a security issue where ACLs were ignored for pages in namespace includes with DokuWiki version Greebo. If you rely on ACL checks in namespace includes or allow edits from users who must not see all pages, please upgrade ASAP! :!: 
 + 
 +This is a handy plugin with which you can include another wiki page into the current one. Just including certain sections of a page or even whole namespaces is supported, too.
  
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 If you need support for older version of DokuWiki you can try the [[https://github.com/downloads/dokufreaks/plugin-include/plugin-include-2009-11-27.tgz|2009-11-27]] version of the include plugin, but please note that this old version has known bugs. If you need support for older versions of DokuWiki in the current include plugin version please open a feature request in the [[https://github.com/dokufreaks/plugin-include/issues|issue tracker]]. If you need support for older version of DokuWiki you can try the [[https://github.com/downloads/dokufreaks/plugin-include/plugin-include-2009-11-27.tgz|2009-11-27]] version of the include plugin, but please note that this old version has known bugs. If you need support for older versions of DokuWiki in the current include plugin version please open a feature request in the [[https://github.com/dokufreaks/plugin-include/issues|issue tracker]].
Line 39: Line 41:
 ===== Syntax ===== ===== Syntax =====
  
-Simply enclose the ID of the page to be included in double curly brackets:+The plugin offers four syntaxes, ''%%{{page>...}}%%'' , ''%%{{section>...}}%%'' , ''%%{{namespace>...}}%%'' and ''%%{{tagtopic>...}}%%''
 + 
 +Section is aimed more at including sections, page at including whole pages and namespace at including whole namespaces. Tagtopic includes all pages with a ''tagtopic'' ''tag''.
  
   {{page>[id]&[flags]}}   {{page>[id]&[flags]}}
Line 51: Line 55:
 ^ [flags] | flags delimited by ''&'', see [[#Configuration and Flags|flags]] | optional | ^ [flags] | flags delimited by ''&'', see [[#Configuration and Flags|flags]] | optional |
  
-The plugin offers four syntaxes, ''%%{{page>...}}%%'' , ''%%{{section>...}}%%'' , ''%%{{namespace>...}}%%'' and ''%%{{tagtopic>...}}%%''. 
- 
-Section is aimed more at including sections, page at including whole pages and namespace at including whole namespaces. Tagtopic includes all pages with a ''tagtopic'' ''tag''. 
  
 ===== Configuration and Flags ===== ===== Configuration and Flags =====
Line 59: Line 60:
 The plugin can be configured in the DokuWiki configuration manager available in the admin menu. These settings also affect the [[plugin:blog]] plugin which uses the include plugin to generate the blog page. For most settings there are flags that allow to override the setting. Some features are only available as flag. The plugin can be configured in the DokuWiki configuration manager available in the admin menu. These settings also affect the [[plugin:blog]] plugin which uses the include plugin to generate the blog page. For most settings there are flags that allow to override the setting. Some features are only available as flag.
  
-^ Configuration option ^ Flags ^ Description ^ +^ Configuration option  ^ Flags                                                            ^ Description                                                                                                                                                                                                                                                                                                                                                                      
-^ ''noheader'' | ''noheader''/ (''show'')''header'' | Don't display the header of the inserted section | +^ ''noheader''          | ''noheader''/ (''show'')''header''                               | Don't display the header of the inserted section                                                                                                                                                                                                                                                                                                                                 
-^ ''firstseconly'' | ''firstsec''(''tion'')''only''/ ''fullpage'' | Display only the first section of the included page | +^ ''firstseconly''      | ''firstsec''(''tion'')''only''/ ''fullpage''                     | Display only the first section of the included page                                                                                                                                                                                                                                                                                                                              
-^ ''readmore'' | ''readmore''/''noreadmore'' | Show "read more" link in case of firstsection only | +^ ''readmore''          | ''readmore''/''noreadmore''                                      | Show "read more" link in case of firstsection only                                                                                                                                                                                                                                                                                                                               
-^ ''showtaglogos'' | - |Show/hide an image for the first tag (if the page has tags) | +^ ''showtaglogos''      | -                                                                | Show/hide an image for the first tag (if the page has tags)                                                                                                                                                                                                                                                                                                                      
-^ ''showfooter'' | ''footer''/''nofooter'' |Show/hide page footer below the included page | +^ ''showfooter''        | ''footer''/''nofooter''                                          | Show/hide page footer below the included page                                                                                                                                                                                                                                                                                                                                    
-^ ''showlink'' | ''link''/''nolink'' | Makes the first headline of a included page/section a link to the included page/section | +^ ''showlink''          | ''link''/''nolink''                                              | Makes the first headline of a included page/section a link to the included page/section                                                                                                                                                                                                                                                                                          
-^ ''showpermalink'' | ''permalink''/ ''nopermalink'' | Show/hide a permalink to the included page in the page footer | +^ ''showpermalink''     | ''permalink''/ ''nopermalink''                                   | Show/hide a permalink to the included page in the page footer                                                                                                                                                                                                                                                                                                                    
-^ ''showdate'' | ''date''/''nodate'' | Show/hide creation date of the page in the page footer | +^ ''showdate''          | ''date''/''nodate''                                              | Show/hide creation date of the page in the page footer                                                                                                                                                                                                                                                                                                                           
-^ ''showmdate'' | ''mdate''/''nomdate'' | Show/hide modification date of the page in the page footer | +^ ''showmdate''         | ''mdate''/''nomdate''                                            | Show/hide modification date of the page in the page footer                                                                                                                                                                                                                                                                                                                       
-^ ''showuser'' | ''user''/''nouser'' | Show/hide user name of the page creator in the page footer | +^ ''showuser''          | ''user''/''nouser''                                              | Show/hide user name of the page creator in the page footer                                                                                                                                                                                                                                                                                                                       
-^ ''showcomments'' | ''comments''/''nocomments'' | Show/hide number of comments in the page footer (requires the [[plugin:discussion]] plugin) | +^ ''showcomments''      | ''comments''/''nocomments''                                      | Show/hide number of comments in the page footer (requires the [[plugin:discussion]] plugin)                                                                                                                                                                                                                                                                                      
-^ ''showlinkbacks'' | ''linkbacks''/''nolinkbacks'' | Show/hide number of linkbacks in the page footer (requires the [[plugin:linkback|linkback]] or [[plugin:backlinks2]] plugin) | +^ ''showlinkbacks''     | ''linkbacks''/''nolinkbacks''                                    | Show/hide number of linkbacks in the page footer (requires the [[plugin:linkback|linkback]] or [[plugin:backlinks]] plugin)                                                                                                                                                                                                                                                     
-^ ''showtags'' | ''tags''/''notags'' | Show/hide tags in the page footer (requires the [[plugin:tag]] plugin) | +^ ''showtags''          | ''tags''/''notags''                                              | Show/hide tags in the page footer (requires the [[plugin:tag]] plugin)                                                                                                                                                                                                                                                                                                           
-^ ''showeditbtn'' | ''editbtn'' or ''editbutton''/''noeditbtn'' or ''noeditbutton'' | Show/hide edit button below the included page | +^ ''showeditbtn''       | ''editbtn'' or ''editbutton''/''noeditbtn'' or ''noeditbutton''  | Show/hide edit buttons (section edit buttons, edit button below the included page)                                                                                                                                                                                                                                                                                               
-^ ''doredirect'' | ''redirect''/''noredirect'' | Redirect back to original page after an edit | +^ ''doredirect''        | ''redirect''/''noredirect''                                      | Redirect back to original page after an edit                                                                                                                                                                                                                                                                                                                                     
-^ ''usernamespace'' | - | Namespace for user pages (see ''showuser'' configuration) (default ''user'') | +^ ''usernamespace''     | -                                                                | Namespace for user pages (see ''showuser'' configuration) (default ''user''                                                                                                                                                                                                                                                                                                    
-^ ''doindent'' | ''indent''/''noindent'' | Indent included pages relative to the section of the page they get included in | +^ ''doindent''          | ''indent''/''noindent''                                          | Indent included pages relative to the section of the page they get included in                                                                                                                                                                                                                                                                                                   
-^ ''linkonly'' | ''linkonly''/''nolinkonly'' or ''include_content'' | Display only a link instead of the whole page content | +^ ''linkonly''          | ''linkonly''/''nolinkonly'' or ''include_content''               | Display only a link instead of the whole page content                                                                                                                                                                                                                                                                                                                            
-^ '' title''| ''title''/''notitle'' | Show the title instead of the page id| +^ '' title''            | ''title''/''notitle''                                            | Show the title instead of the page id                                                                                                                                                                                                                                                                                                                                            
-^ ''pageexists''| ''pageexists''/ ''nopageexists'' | Only list page ids of existing pages (see ''existlink'')| +^ ''pageexists''        | ''pageexists''/ ''nopageexists''                                 | Only list page ids of existing pages (see ''existlink''                                                                                                                                                                                                                                                                                                                        
-^ -| ''existlink'' | Display a link and do so only if page page-id exists (combination of ''linkonly'' and ''pageexists'')| +^ -                     | ''existlink''                                                    | Display a link and do so only if page page-id exists (combination of ''linkonly'' and ''pageexists''                                                                                                                                                                                                                                                                           
-^ ''parlink''| ''parlink''/''noparlink'' | (Don't) put the link into a paragraph environment (for inline lists) | +^ ''parlink''           | ''parlink''/''noparlink''                                        | (Don't) put the link into a paragraph environment (for inline lists)                                                                                                                                                                                                                                                                                                             
-^ ''order'' | ''order=OPTION'' | Ordering criteria for namespace includes, possible options: page ID (''id''), title (''title''), date created (''created''), date modified (''modified''), [[plugin:indexmenu#metadata_tag_syntax|indexmenu sort order]] (''indexmenu''), custom sort order using the ''%%{{include_n>[number]}}%%'' on the pages that are included similar to the indexmenu tags (''custom''). | +^ ''order''             | ''order=OPTION''                                                 | Ordering criteria for namespace includes, possible options: page ID (''id''), title (''title''), date created (''created''), date modified (''modified''), [[plugin:indexmenu#metadata_tag_syntax|indexmenu sort order]] (''indexmenu''), custom sort order using the ''%%{{include_n>[number]}}%%'' on the pages that are included similar to the indexmenu tags (''custom'').  
-^ ''rsort'' | ''rsort''/''sort'' | Reverse the sort order in namespace includes. | +^ ''rsort''             | ''rsort''/''sort''                                               | Reverse the sort order in namespace includes.                                                                                                                                                                                                                                                                                                                                    
-^ ''depth'' | ''depth=DEPTH'' | The maximum depth of subnamespaces of which pages are included in namespace includes, default is ''1'' for only the specified namespace, ''0'' is for unlimited depth. | +^ ''depth''             | ''depth=DEPTH''                                                  | The maximum depth of subnamespaces of which pages are included in namespace includes, default is ''1'' for only the specified namespace, ''0'' is for unlimited depth.                                                                                                                                                                                                           
-^ - | ''inline'' | Don't close/open sections when including a page. This flag should be used when the include syntax is used inside other syntax elements like lists or tables or inside other plugin syntax. | +^ -                     | ''inline''                                                       | Don't close/open sections when including a page. This flag should be used when the include syntax is used inside other syntax elements like lists or tables or inside other plugin syntax.                                                                                                                                                                                       
-^ - | ''beforeeach=ENTITY''/ ''aftereach=ENTITY'' | Display an [[:entities|entity]] before/after each included page. The entity is printed outside the section/include environment, this is mainly for adding custom HTML code (when the text isn't recognized as entity it is directly displayed but escaped so you can't directly use HTML code here). | +^ -                     | ''beforeeach=ENTITY''/ ''aftereach=ENTITY''                      | Display an [[:entities|entity]] before/after each included page. The entity is printed outside the section/include environment, this is mainly for adding custom HTML code (when the text isn't recognized as entity it is directly displayed but escaped so you can't directly use HTML code here).                                                                             
-^ ''safeindex''| - | Don't index metadata of included pages that are non-public. This can cause problems with other plugins that use the metadata index and can be safely disabled in wikis where the permissions of the included pages match the permissions of the parent pages. |+^ ''safeindex''         | -                                                                | Don't index metadata of included pages that are non-public. This can cause problems with other plugins that use the metadata index and can be safely disabled in wikis where the permissions of the included pages match the permissions of the parent pages.                                                                                                                    | 
 +^ -                     | ''exclude=/REGEX/''                                              | Regular expression to exclude certain pages, will match on full page ID. E.g. to exclude ''ns:page_name'' use ''/ns:page_name/'' as value. Use a [[https://regex101.com/|regex tester]] to debug complicated patterns.                                                                                                                                                           |
  
  
Line 95: Line 97:
   {{page>mypage&noindent}}   {{page>mypage&noindent}}
   {{namespace>myns&order=modified}}   {{namespace>myns&order=modified}}
 +  {{namespace>myns&exclude=/myns:subns:.+|myns:page/}}
  
  
Line 127: Line 130:
  
   {{page>@USER@:message}}   {{page>@USER@:message}}
-incudes the page ''message'' from the namespace <user> of the logged in user+includes the page ''message'' from the namespace <user> of the logged in user
  
   {{page>foo@DATENWEEK@@YEAR@:@WEEK@}}   {{page>foo@DATENWEEK@@YEAR@:@WEEK@}}
Line 136: Line 139:
 FIXME There is currently no demo site available. FIXME There is currently no demo site available.
  
-Use of the plugin is shown in this video here: https://www.youtube.com/watch?v=6RO8TSZBedU+Use of the plugin is shown in this video here: https://www.youtube.com/watch?v=6RO8TSZBedU&t=8m47s 
 +FIXME Video not available (2021-03-20)
 ===== Development ===== ===== Development =====
  
Line 207: Line 211:
  
 The include plugin has many feature and is very flexible and I'm willing to add more features if they fit in the general purpose of the include plugin. However there is no guarantee that I will implement a certain feature at a certain time, this depends completely on my available time and my mood. You can add your wishes to the issue tracker. The include plugin has many feature and is very flexible and I'm willing to add more features if they fit in the general purpose of the include plugin. However there is no guarantee that I will implement a certain feature at a certain time, this depends completely on my available time and my mood. You can add your wishes to the issue tracker.
 +
 +==== How to avoid including of whole page content if section does not exist? ====
 +
 +If using the flag ''firstsectiononly'' in addition, could be one solve. At least in regard of avoiding very large content to be displayed. If adding a header at the source page and using tools like the [[plugin:hiddenheader]] it might solve things at the source page, but in it's case seems to conflict and break certain include flag-tasks.
 ===== Discussion ===== ===== Discussion =====
  
Line 212: Line 220:
  
 If you miss a comment you've created please have a look at the [[#FAQ]] section and the [[https://github.com/dokufreaks/plugin-include/issues|issue tracker]], I might have moved them there, if you can't find a bug report anymore that bug should be solved, please try the current version and report it again if it still doesn't work. If you miss a comment you've created please have a look at the [[#FAQ]] section and the [[https://github.com/dokufreaks/plugin-include/issues|issue tracker]], I might have moved them there, if you can't find a bug report anymore that bug should be solved, please try the current version and report it again if it still doesn't work.
 +
 +==== Discussions in DW-forum ====
 +
 +  * [[https://forum.dokuwiki.org/thread/16154|plugin:include / Hide current page contents once user logs in]]
 +  * [[https://forum.dokuwiki.org/thread/16235|include plugin: development in direction to use it as a kind database tool]], feature inspirations.
 +
 +
  
 ==== User comments ===== ==== User comments =====
Line 307: Line 322:
  --- [[user>TotallyInformation|Julian Knight]] //2012-03-23//  --- [[user>TotallyInformation|Julian Knight]] //2012-03-23//
  
 +Does it still work? Can't make it on my wiki page.
 +
 + --- //Piotr// //2017-10-04//
 ==== Align Feature ==== ==== Align Feature ====
 It'll be great to be able to align included pages. Because a lot of people are using this feature for infobox purposes and some would love to be able to control the alignment of the <code>{{page>people:obama}}</code> using the core syntax by adding spaces before of after the syntax.  It'll be great to be able to align included pages. Because a lot of people are using this feature for infobox purposes and some would love to be able to control the alignment of the <code>{{page>people:obama}}</code> using the core syntax by adding spaces before of after the syntax. 
Line 333: Line 351:
  
 ---- Chris // 2016-2-21 09:12//  ---- Chris // 2016-2-21 09:12// 
 +
  
 [[plugin:blog|blog plugin]] supports **Exclude Feature ** [[plugin:blog|blog plugin]] supports **Exclude Feature **
 +
  --- HsinTang // 2016-07-26 //  --- HsinTang // 2016-07-26 //
 +
 +
 +I created [[https://github.com/dokufreaks/plugin-include/pull/243|a PR]] for an exclude option! Testing or adding tests would be appreciated.
 +
 + --- [[user>sleeping|sleeping]] //2020-04-11 07:57//
 +
 +The ''exclude'' flag has been merged! :-)
 +
 + --- [[user>sleeping|sleeping]] //2020-04-16 19:28//
  
 ==== Empty Section ====  ==== Empty Section ==== 
Line 342: Line 371:
  
  --- Simon // 2015-02-02 14:50 //   --- Simon // 2015-02-02 14:50 // 
 +
 +>Just thought of asking about this issue. Is there any possibility to avoid that?  --- [[user>Samana Johann|Samana Johann]] //2018-08-20 19:45//
  
 ==== No Other data ==== ==== No Other data ====
Line 359: Line 390:
 --- vt306 //2017.03.29// --- vt306 //2017.03.29//
  
 +Thanks to Michael Hamann for the advice. The [[doku>plugin:pagequery|pagequery]] plugin is the solution for this.
 +
 +--- vt306 //2017.04.06//
 +
 +==== Option to pass revision of main page to includes pages ====
 +
 +We are currently using DokuWiki for technical documentation. Within DokuWiki we use the 'date_at' function (https://www.dokuwiki.org/date_at) to go back to an old revision to see which version of the page a customer recieved. It would be very usefull if the included pages would honour the revision of the main page. To clarify: if the main page is shown at a specific revision, the included pages should also be shown at the last revision before the date of the main page. Would something like that be possible to incorporate?
 +
 +Thanks in advance!
 +Ruud 
 +
 +==== Translations ====
 +
 +>If it is of use, a paticular Translation of the Plugin's info page into German can be taken from [[http://accesstoinsight.eu/doku.php?id=external:index#include_plugin|here]]. --- [[user>Samana Johann|Samana Johann]] //2018-08-20 12:11//
 +
 +==== Display search results on a page? ====
 +Hi, I was wondering if it is possible to display the search result of a term or phrase on a page?
 +
 +- OYMYO
 +
 +==== Options/arguments ====
 +
 +I think it would be cool if this plugin supported [[https://www.mediawiki.org/wiki/Help:Templates#Parameters|options/arguments like in MediaWiki]].
 +
 +Something like this:
 +
 +<file - page1.txt>
 +Test by {{{1}}}
 +</file>
 +
 +<file - page2.txt>
 +{{page>:page1|Me}}
 +</file>
 +
 +And ''page2'' would be parsed into:
 +
 +  Test by Me
 +
 + --- [[user>hasha2982|hasha2982]] //2020-08-19 17:12//
 +
 +> Sorry, didn't know about the [[plugin:templater|Templater Plugin]] --- [[user>hasha2982|hasha2982]] //2020-08-19 17:25//
plugin/include.1491550092.txt.gz · Last modified: 2017-04-07 09:28 by 93.81.210.107

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