{"id":17819,"date":"2022-07-19T01:13:14","date_gmt":"2022-07-19T05:13:14","guid":{"rendered":"https:\/\/pacificopencourses.col.org\/edt4ol\/?page_id=17819"},"modified":"2022-07-19T01:13:14","modified_gmt":"2022-07-19T05:13:14","slug":"basic-text-transclusion","status":"publish","type":"page","link":"https:\/\/pacificopencourses.col.org\/edt4ol\/learning-challenges\/intermediate-wiki-skills\/basic-text-transclusion\/","title":{"rendered":"Basic text transclusion"},"content":{"rendered":"<div id=\"content\" class=\"mw-body container\" role=\"main\">\n<div class=\"row\">\n<div class=\"col-md-12\">\n<div class=\"panel\">\n<div class=\"panel-body\">\n<div id=\"bodyContent\">\n<div id=\"mw-content-text\" lang=\"en\" dir=\"ltr\" class=\"mw-content-ltr\"><div class=\"panel iDevice\">\n\t<div class=\"panel-heading idevice-heading\">\n\t\t<div>\n\t\t\t<img decoding=\"async\" class=\"pedagogicalicon\" alt=\"definition\" src=\"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-content\/themes\/oeru-course\/idevices\/Icon_define.png\">\n\t\t<\/div>\n\t\t<div>\n\t\t\t<h2>Definition<\/h2>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"panel-body\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<\/p>\n<p><b>Transclusion<\/b><sup id=\"cite_ref-1\" class=\"reference\"><a href=\"#cite_note-1\">[1]<\/a><\/sup><br \/>\nIn computer science, transclusion is the inclusion of part or all of an electronic document into one or more other documents by hypertext reference. Transclusion is usually performed when the document referencing the part of another document is displayed, and is normally automatic and transparent to the end user. The result of transclusion is a single integrated document made of parts assembled dynamically from separate sources, possibly stored on different computers in disparate places.\n<\/p>\n<p>\n<\/p>\n<p>\n\t\t<\/div>\n\t<\/div>\n<\/div><\/p>\n<p>\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Transclusion_in_practice\">Transclusion in practice<\/span><\/h2>\n<div class=\"floatright\"><a href=\"https:\/\/wikieducator.org\/File:Transclusion_simple.svg\" class=\"image\"><img loading=\"lazy\" decoding=\"async\" alt=\"Transclusion simple.svg\" src=\"\/\/wikieducator.org\/images\/thumb\/5\/59\/Transclusion_simple.svg\/400px-Transclusion_simple.svg.png\" width=\"400\" height=\"400\" class=\"img-responsive\"><\/a><\/div>\n<p>In practice this means that wiki text from Page B (the source page for transclusion) can be automatically incorporated into Page A (the referencing page). This is a powerful feature of the Mediawiki software which is used when developing online content to save time and optimize wiki-pages for reuse and remix in different contexts.<\/p>\n<p>A major advantage of transclusion is that there is a single source for high usage text that only needs to be changed in one place for all pages that reference the tranclusion text in cases where the text must be changed in the future. So for example, if the course title is transcluded across all wiki pages refencing the course title, in the event that the course title changes in the future, there is only one place where the change needs to be recorded. The revise course title will then propagate to all pages on a course site reference the transcluded course title.\n<\/p>\n<p>Typical use cases for transclusion include:\n<\/p>\n<ul>\n<li> Text which is <b>repeated frequently<\/b> across multiple pages in the online materials. For example, the course name, course code or introductory text repeated on multiple pages like instructions for a quiz at the end of every learning sequence.\n<\/li>\n<li> <b>URLs<\/b> for links to selected web-site pages <b>that may change in the future<\/b>. For instance a URL to a discussion forum topic to provide flexibility to shift the discussion forum to an alternate platform in the future.\n<\/li>\n<li> Reuse of <b>complex wiki markup<\/b> for features that are embedded frequently on a course website. For example, the wiki markup needed for inserting a WikiEducator Note (WEnote) post for in page comments that can be harvested in a course feed.\n<\/li>\n<li> Creating capability for easy editing of <b>variable information<\/b> within course sites for future reuse. For example, transcluding calendar information (dates, days, etc.) within course pages where different cohort offerings are envisaged  for the future.\n<\/li>\n<\/ul>\n<h2><span class=\"mw-headline\" id=\"Overview_of_transclusion_markup\">Overview of transclusion markup<\/span><\/h2>\n<p>The basic wiki markup for transclusion is two curly brackets, followed by a colon which precedes the wiki page name referenced for transclusion before closing with two curly brackets.\n<\/p>\n<ul>\n<li> <b>Step 1<\/b>: Create a wiki page that contains the text you want to transclude (Page B)\n<\/li>\n<li> <b>Step 2<\/b>: On Page A, where you want to insert the transcluded text from Page B, insert the wiki markup to reference page B, for example:\n<\/li>\n<\/ul>\n<pre>{{:wiki_page_name_for_page_B}}\n<\/pre>\n<ul>\n<li> Notes:\n<ul>\n<li>The colon followed by the wiki page name is used for transcluding pages in the main wiki namespace. This will not work for pages in the <code>Template:<\/code> or <code>User:<\/code> namespaces. (The concept of namespace refers to pre-defined areas in the wiki used for different purposes, for example general wiki pages, template pages, user pages etc.)\n<\/li>\n<li> When transcluding pages from the <code>Template:<\/code> or <code>User:<\/code> namespaces, the colon is not inserted in front of the page name. For example, to transclude a template, the following syntax is used:\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>{{Template:Name_of_template}}\n<\/pre>\n<h2><span class=\"mw-headline\" id=\"Simple_transclusion\">Simple transclusion<\/span><\/h2>\n<div class=\"panel iDevice\">\n\t<div class=\"panel-heading idevice-heading\">\n\t\t<div>\n\t\t\t<img decoding=\"async\" class=\"pedagogicalicon\" alt=\"activity\" src=\"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-content\/themes\/oeru-course\/idevices\/Icon_activity.png\">\n\t\t<\/div>\n\t\t<div>\n\t\t\t<h2>Transclusion activity<\/h2>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"panel-body\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<\/p>\n<p><b>Purpose: Practice transcluding text from an existing wiki page.<\/b>\n<\/p>\n<p>&lt;<b>Insert demo video<\/b>&gt;\n<\/p>\n<ol>\n<li> Visit the following page where the full title for this course is stored for transclusion purposes: <a rel=\"nofollow\" class=\"external free\" href=\"https:\/\/wikieducator.org\/EDT4OL\/Links\/course_title\">https:\/\/wikieducator.org\/EDT4OL\/Links\/course_title<\/a> (Open this link in a new tab to see the text for the course title.)\n<\/li>\n<li> Go to your practice subpage on your <a rel=\"nofollow\" class=\"external text\" href=\"https:\/\/wikieducator.org\/Special:MyPage\/Sandbox\">sandbox page<\/a>, and insert the following wiki markup: <code>{{:EDT4OL\/Links\/course_title}}<\/code>.\n<\/li>\n<li> Save the page. If you have done this correctly, the title text will now be transcluded into your sandbox practice page.\n<\/li>\n<\/ol>\n<p>\n<\/p>\n<p>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n<p>\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Boilerplate_text\">Boilerplate text<\/span><\/h2>\n<p>In some cases, whole pages or large sections of text with a predefined layout for frequent reuse, can be set up as &#8220;Boilerplate&#8221; text for transclusion. These pages can include images headings, subheadings and pedagogical templates for transclusion. This saves time in having to type out large sections of text that are reused frequently.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Parameters_for_boilerplate_text\">Parameters for boilerplate text<\/span><\/h2>\n<p><b>Not required for this course<\/b>\n<\/p>\n<p>It is also possible to incorporate parameters within boilerplate transclusion text for displaying variable information. This is the same technique used for specifying the variables used to manage the layout of pedagogical templates. For the purposes of this course <b>you are not required<\/b> to know how to incorporate numbered or named parameters for transcluded text. However, for any learners interested in building capability for these more advanced features, you can consult the Mediawiki <a class=\"external text\" href=\"https:\/\/www.mediawiki.org\/wiki\/Help:Templates\">general help section on Templates<\/a>.\n<\/p>\n<p>Typically, named parameters are inserted between three curly brackets within the transclusion text or template, for example: <code>{{{Named_parameter_one}}}<\/code>. We mention this here in the event that you encounter examples in Mediawiki transclusions for other published courses so that you know what they are.  In cases where named paramaters are included in transcluded text, the variables are separated by vertical bars (&#8220;<code>|<\/code>&#8220;) as illustrated in the following example:\n<\/p>\n<pre>{{:wiki_page_name_for_transclusion_text|Named_parameter_one=}}\n<\/pre>\n<h2><span class=\"mw-headline\" id=\"Reference\">Reference<\/span><\/h2>\n<ol class=\"references\">\n<li id=\"cite_note-1\"><span class=\"mw-cite-backlink\"><a href=\"#cite_ref-1\">\u2191<\/a><\/span> <span class=\"reference-text\">Definition adapted from Wikipedia article on <a rel=\"nofollow\" class=\"external text\" href=\"https:\/\/en.wikipedia.org\/wiki\/Transclusion\">Transclusion<\/a><\/span>\n<\/li>\n<\/ol>\n<p><!-- \nNewPP limit report\nCPU time usage: 0.151 seconds\nReal time usage: 1.158 seconds\nPreprocessor visited node count: 262\/1000000\nPreprocessor generated node count: 1044\/1000000\nPost\u2010expand include size: 5487\/2097152 bytes\nTemplate argument size: 2589\/2097152 bytes\nHighest expansion depth: 7\/40\nExpensive parser function count: 0\/100\n--><\/p>\n<p><!-- Saved in parser cache with key we_en-mw_:pcache:idhash:189433-0!*!*!!en!2!* and timestamp 20220719051312 and revision id 1093200\n -->\n<\/div>\n<div class=\"visualClear\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"row\">\n<div class=\"col-md-12\">\n<ul class=\"pager\">\n<li class=\"previous\">\n            <a href=\"\/edt4ol\/learning-challenges\/intermediate-wiki-skills\/wiki-quizzes\">\u2190 Previous<\/a>\n          <\/li>\n<li class=\"next\">\n            <a href=\"\/edt4ol\/learning-challenges\/intermediate-wiki-skills\/intermediate-wiki-skills-challenge\">Next \u2192<\/a>\n          <\/li>\n<\/ul><\/div>\n<\/p><\/div>\n<div id=\"wenote-ids\"><script type='text\/javascript' id='wenotes-ids'>\n    var WEnotesSite = \"https:\/\/wikieducator.org\";\n    var WEnotesPath = \"\/EDT4OL\/Intermediate_wiki_skills\/Basic_transclusion\";\n    var WEnotesSiteID = \"0e3d258fbd36841f92259eefcd41d5e9\";\n    var WEnotesPathID = \"59922f9593f87b53f3c3be91610bdfad\";\n    var WEnotesIDs = { site: \"https:\/\/wikieducator.org\", path: \"\/EDT4OL\/Intermediate_wiki_skills\/Basic_transclusion\", site_id: \"0e3d258fbd36841f92259eefcd41d5e9\", path_id: \"59922f9593f87b53f3c3be91610bdfad\" };\n<\/script><\/div>\n<\/div>\n<footer><\/footer>\n","protected":false},"excerpt":{"rendered":"<p>Transclusion in practice In practice this means that wiki text from Page B (the source page for transclusion) can be automatically incorporated into Page A (the referencing page). This is a powerful feature of the Mediawiki software which is used when developing online content to save time and optimize wiki-pages for reuse and remix in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":17799,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-17819","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/pages\/17819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/comments?post=17819"}],"version-history":[{"count":1,"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/pages\/17819\/revisions"}],"predecessor-version":[{"id":17820,"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/pages\/17819\/revisions\/17820"}],"up":[{"embeddable":true,"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/pages\/17799"}],"wp:attachment":[{"href":"https:\/\/pacificopencourses.col.org\/edt4ol\/wp-json\/wp\/v2\/media?parent=17819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}