{"id":13067,"date":"2024-09-09T12:16:07","date_gmt":"2024-09-09T12:16:07","guid":{"rendered":"https:\/\/www.fhug.org.uk\/kb\/?post_type=kb_article&#038;p=13067"},"modified":"2024-09-09T13:25:41","modified_gmt":"2024-09-09T13:25:41","slug":"configuring-templated-sources-to-use-the-generic-repository-field","status":"publish","type":"kb_article","link":"https:\/\/www.fhug.org.uk\/kb\/kb-article\/configuring-templated-sources-to-use-the-generic-repository-field\/","title":{"rendered":"Configuring Templated Sources to Use the Generic Repository Field"},"content":{"rendered":"<p>Generic sources are linked to repositories via a repository field, whereas by default, templated sources are linked to repositories via a template repository metafield.<\/p>\n<p>If you&#8217;re only using generic sources, you don&#8217;t need to read any further.<\/p>\n<p>If you&#8217;re only using templated sources, your data entry and presentation will be consistent. However:<\/p>\n<ul>\n<li>you will need to adjust queries created before templated sources were introduced to use the template repository metafield instead of the generic repository field.<\/li>\n<li>you will need to configure the source record window to show the template repository metafield rather than the generic one, if you wish to show it.<\/li>\n<li>you will need to take care when exporting templated sources, to ensure that their non-standard GEDCOM representation of the repository is correctly interpreted at the receiving end.<\/li>\n<\/ul>\n<p>And if you are mixing generic and templated sources, in addition to the points noted above, the different handling of repositories can create complications when viewing the source record window, or querying sources, because there are two fields that could be relevant.<\/p>\n<p>We don&#8217;t recommend mixing the two types of source, because of the potential inconsistencies of presentation, but if you choose to do so, it is possible to configure templated sources to use the generic repository field.<\/p>\n<p>Actually, it&#8217;s already present for all templated sources, just not visible by default (as are all generic source fields).<\/p>\n<p>There are also advantages in using the generic repository field for templated sources, even if you are not also using generic sources: it simplifies export to other programs and website (although it does not eliminate all the compatibility issues associated with templated sources); and it retains compatibility with older queries.<\/p>\n<p><strong>Warning<\/strong>: it will be a hard work to arrive at a consistent way of working with templated sources and the generic repository field if you have already created a lot of templated sources without it. It is best embarked upon as part of the process of deciding how to use templated sources, before you start creating any sources. It will also be much easier if you create your own source template definitions, either from scratch or by cloning definitions provided with FH (because the standard template definitions cannot be edited).<\/p>\n<p><strong>Note:\u00a0<\/strong>Some source templates (e.g. in the Advanced collection) may have multiple Repository metafields. GEDCOM 5.5.1 supports multiple instances of the generic repository field, but that scenario isn&#8217;t addressed in detail here.<\/p>\n<p>Please read the whole article before making any changes!<\/p>\n<h2>Steps In Outline<\/h2>\n<p>To swap from using template repository metafields to generic repository fields, you need to:<\/p>\n<ol>\n<li>Make the generic repository field visible for templated sources in:\n<ul>\n<li>The source property box<\/li>\n<li>The citation window<\/li>\n<li>The record window for sources<\/li>\n<\/ul>\n<\/li>\n<li>If necessary, transfer any existing data from template repository metafields to the generic repository field (for all templated sources)<\/li>\n<li>Convert any standard templates to custom ones (as standard template definitions can&#8217;t be edited)<\/li>\n<li>Adjust all custom templates to use the generic repository field in display formats, and to remove the template repository metafield from all custom template definitions and records.<\/li>\n<\/ol>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Make Generic Repository Field Visible<\/h3><\/summary><div class=\"lightweight-accordion-body\"><div class=\"gca-column two-fifths first\">\n<p>In the Property Box for a Source record:<\/p>\n<ol>\n<li>Go to <em>Customise Property Box<\/em> via the Cog Icon<\/li>\n<li>Choose the <em>Main (template)<\/em> tab<\/li>\n<li>Select the <em>Repository<\/em> item in the left hand pane (Available items), and use the right arrow in the centre to move it to the right hand pane, then use the up and down arrows to move it to the position you want, typically below the <em>Template Fields<\/em>.<\/li>\n<li>Click <em>OK<\/em>.<\/li>\n<\/ol>\n<\/div>\n<div class=\"gca-column three-fifths\">\n<p><img decoding=\"async\" class=\"size-large wp-image-13068 alignnone lazyload\" data-src=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532-1024x737.png\" alt=\"\" width=\"640\" height=\"461\" data-srcset=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532-1024x737.png 1024w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532-300x216.png 300w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532-150x108.png 150w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532-768x553.png 768w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-125532.png 1451w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; --smush-placeholder-aspect-ratio: 640\/461;\" \/><\/p>\n<\/div>\n<div class=\"gca-column two-fifths first\">\n<p>Your property box for a templated source will now show the generic repository field (highlighted in green ) and probably also a template repository metafield (highlighted in orange). You can tell the difference between the two because the template metafield is prefixed by a bullet and the generic field is not.<\/p>\n<p>And if you now go to <em>Prepare a Citation<\/em> via the scroll item on the main toolbar, you will see that this change has been made in the Citation window as well.<\/p>\n<\/div>\n<div class=\"gca-column three-fifths\">\n<p><img decoding=\"async\" class=\"size-large wp-image-13069 alignnone lazyload\" data-src=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837-1024x883.png\" alt=\"\" width=\"640\" height=\"552\" data-srcset=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837-1024x883.png 1024w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837-300x259.png 300w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837-150x129.png 150w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837-768x662.png 768w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-130837.png 1167w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; --smush-placeholder-aspect-ratio: 640\/552;\" \/><\/p>\n<\/div>\n<div class=\"gca-column two-fifths first\">\n<p>Now go to the <em>Source Record Window. <\/em>Right-click anywhere on the column headers and choose <em>Configure Columns<\/em>.<\/p>\n<p>Check if there is already a Repository column present. if it exists, use <em>Edit<\/em> to check that it refers to <code>%SOUR.REPO[1]&gt;%<\/code> and change it it if doesn&#8217;t (for the template metafield it will be something like <code>%SOUR.~RP-REPOSITORY&gt;% <\/code>where the element after ~ may vary if the Repository metafield has a different name.<\/p>\n<p>If it doesn&#8217;t exist and you want to display the Repository, choose <em>&lt;Other&gt; <\/em>in the left hand pane, enter a name for the column (usually Repository) and click <em>Insert Data Ref..<\/em>. In the dialog that appears, choose <em>Repository<\/em> (<code>%SOUR.REPO[1]&gt;%<\/code>) and click <em>OK<\/em>. Then click <em>Add<\/em>, and position the column using the up and down arrows before finally clicking <em>OK<\/em>.<\/p>\n<\/div>\n<div class=\"gca-column three-fifths\">\n<p><img decoding=\"async\" class=\"size-large wp-image-13070 alignnone lazyload\" data-src=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332-758x1024.png\" alt=\"\" width=\"640\" height=\"865\" data-srcset=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332-758x1024.png 758w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332-222x300.png 222w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332-111x150.png 111w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332-768x1038.png 768w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-03-133332.png 1030w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; --smush-placeholder-aspect-ratio: 640\/865;\" \/><\/p>\n<\/div>\n<\/div><\/details><\/div>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Transfer Repository Data<\/h3><\/summary><div class=\"lightweight-accordion-body\"><p>This only applies if you have already created some templated sources.<\/p>\n<p>To transfer the repository data from templated repository metafields to the corresponding generic repository field, you need to open each Templated Source in turn and cut-and-paste the data between the two fields (<strong>from<\/strong> the template metafield prefixed with a bullet <strong>to\u00a0<\/strong>the generic field which does not have a bullet.). It should be possible to automate it with a simple plugin, but there isn&#8217;t one publicly available.<\/p>\n<p>Make sure you complete the data transfer before adjusting any templates, so that you don&#8217;t inadvertently lose data.<\/p>\n<\/div><\/details><\/div>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Convert Standard Templates to Custom Templates<\/h3><\/summary><div class=\"lightweight-accordion-body\"><p>The standard Source Template Definitions cannot be edited, so you must first clone all the standard templates you use or intend to use via <em>Tools &gt; Source Template Definitions<\/em>, then <em>Clone<\/em>. Chose a meaningful name for the custom collection that will help you remember where they came from &#8212; e.g Custom Essentials For each template you create, use <em>Add to Project<\/em> to make it available for use.<\/p>\n<p>Next, you must edit any sources you&#8217;ve already created using the standard templates to use their custom equivalents.<\/p>\n<p>Start by downloading and installing the Change Source Template plugin from t<a href=\"https:\/\/www.fhug.org.uk\/forum\/viewtopic.php?t=19143\">his forum thread.<\/a> (To install it, open the downloaded file by double-clicking on it). Run the plugin for each of your new source templates in turn.<\/p>\n<div class=\"gca-column two-fifths first\">\n<p>For each template, choose the old (standard template) and the new (custom template) and click <em>OK<\/em>.<\/p>\n<\/div>\n<div class=\"gca-column three-fifths\">\n<p><img decoding=\"async\" class=\"size-full wp-image-13073 alignnone lazyload\" data-src=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191340.png\" alt=\"\" width=\"842\" height=\"213\" data-srcset=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191340.png 842w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191340-300x76.png 300w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191340-150x38.png 150w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191340-768x194.png 768w\" data-sizes=\"(max-width: 842px) 100vw, 842px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 842px; --smush-placeholder-aspect-ratio: 842\/213;\" \/><\/p>\n<\/div>\n<div class=\"gca-column two-fifths first\">\n<p>As you have not altered anything in the template after cloning it, the mappings will be correct, so press <em>OK<\/em>.<\/p>\n<\/div>\n<div class=\"gca-column three-fifths\">\n<p><img decoding=\"async\" class=\"size-full wp-image-13074 alignnone lazyload\" data-src=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191552.png\" alt=\"\" width=\"887\" height=\"982\" data-srcset=\"https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191552.png 887w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191552-271x300.png 271w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191552-135x150.png 135w, https:\/\/www.fhug.org.uk\/kb\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-05-191552-768x850.png 768w\" data-sizes=\"(max-width: 887px) 100vw, 887px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 887px; --smush-placeholder-aspect-ratio: 887\/982;\" \/><\/p>\n<\/div>\n<p>Select all the Source records based on the relevant template type, and press <em>OK<\/em>.<\/p>\n<p>Once you&#8217;ve changed all your sources to use the new custom templates, you can delete the unused standard templates from your project via the Source Templates Records window. Remember to check that they are not in use &#8212; i.e. the links count is zero &#8212; before deleting them. If they are in use, use View &gt; Record Links to track down the sources and run the plugin again as necessary.<\/p>\n<\/div><\/details><\/div>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Adjust Custom Templates<\/h3><\/summary><div class=\"lightweight-accordion-body\"><p>For each template, you must adjust the source display formats (Title, Footnote, Bibliography etc.) to use the generic repository reference <code>{%SOUR.REPO%}<\/code> and not the template repository field <code>{REPOSITORY}<\/code> wherever it occurs.<\/p>\n<p>It is unfortunately not possible to hide a single template field in the Source Property Box\/Citation Window, so the template Repository field must then be removed.<\/p>\n<\/div><\/details><\/div>\n<p>You now have a set of custom templates that use the generic Repository field rather than a Repository metafield; and all your templated sources have been converted to use them.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"template":"","fh_version":[739],"skill_level":[17],"topic":[83],"class_list":["post-13067","kb_article","type-kb_article","status-publish","hentry","fh_version-v7","skill_level-intermediate","topic-sources-and-citations"],"_links":{"self":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/13067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/types\/kb_article"}],"wp:attachment":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/media?parent=13067"}],"wp:term":[{"taxonomy":"fh_version","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/fh_version?post=13067"},{"taxonomy":"skill_level","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/skill_level?post=13067"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/topic?post=13067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}