{"id":2389,"date":"2026-08-28T11:47:30","date_gmt":"2026-08-28T11:47:30","guid":{"rendered":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/?post_type=knowledgebase&#038;p=2389"},"modified":"2026-08-29T02:37:45","modified_gmt":"2026-08-29T02:37:45","slug":"adding-custom-templates","status":"publish","type":"knowledgebase","link":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/db\/templates\/adding-custom-templates\/","title":{"rendered":"Adding Custom Templates"},"content":{"rendered":"<div style=\"color: #2b2b2b;\">\n<h2 class=\"western\"><span style=\"color: #007670;\">Adding Custom Templates<img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-2403\" src=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery.webp\" alt=\"Adding Custom Templates\" width=\"304\" height=\"144\" srcset=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery.webp 1761w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery-300x143.webp 300w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery-1024x487.webp 1024w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery-768x365.webp 768w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/PublicatioTemplateGallery-1536x730.webp 1536w\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" \/><\/span><\/h2>\n<p class=\"western\">If you are self-hosting Open Publisher, you can add your own custom templates to the <strong>Publication Templates Gallery<\/strong>. Because templates use a modular architecture, you can add as many as you like without ever needing to modify the core JavaScript bundle.<\/p>\n<h3 class=\"western\"><span style=\"color: #007670;\">Step 1: Create your .opub File<img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-2401\" src=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/CreateYourOpubFile.webp\" alt=\"reate your .opub File\" width=\"287\" height=\"180\" srcset=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/CreateYourOpubFile.webp 584w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/CreateYourOpubFile-300x188.webp 300w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/span><\/h3>\n<ol>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\">Create a new publication in the editor and design your template.<\/span><\/p>\n<\/li>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\">Export your work and save it as an <span style=\"font-family: Courier New, monospace;\">.opub<\/span> file.<\/span><\/p>\n<\/li>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\">Place this file into the <span style=\"font-family: Courier New, monospace;\">elements\/templates\/files\/<\/span> directory on your server.<\/span><\/p>\n<\/li>\n<\/ol>\n<p class=\"western\"><em>(Example: elements\/templates\/files\/my_custom_flyer.opub)<\/em><\/p>\n<h3 class=\"western\"><span style=\"color: #007670;\">Step 2: Register the Template<img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-2398\" src=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RegisterTemplates.webp\" alt=\"Register the Template\" width=\"128\" height=\"116\" srcset=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RegisterTemplates.webp 459w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RegisterTemplates-300x272.webp 300w\" sizes=\"auto, (max-width: 128px) 100vw, 128px\" \/><\/span><\/h3>\n<p class=\"western\">Next, open the <span style=\"font-family: Courier New, monospace;\">elements\/templates\/template-index.json<\/span> file in a text editor. Add a new JSON entry for your template using the following keys:<\/p>\n<pre><code class=\"language-json\">{\r\n  \"c\": \"Flyers\", \r\n  \"n\": \"My Custom Flyer\", \r\n  \"file\": \"my_custom_flyer.opub\"\r\n}<\/code><\/pre>\n<ul>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\"><strong>c (Category) \u2014<\/strong> The exact name of the Category tab the template should appear under (e.g., &#8220;Flyers&#8221;, &#8220;Resumes&#8221;, &#8220;Business Cards&#8221;).<\/span><\/p>\n<\/li>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\"><strong>n (Name) \u2014<\/strong> The human-readable display name for the template.<\/span><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-2396\" src=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RefreshTheGallery.webp\" alt=\"Step 3: Refresh the Gallery\" width=\"108\" height=\"115\" srcset=\"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RefreshTheGallery.webp 408w, http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-content\/uploads\/2026\/08\/RefreshTheGallery-281x300.webp 281w\" sizes=\"auto, (max-width: 108px) 100vw, 108px\" \/><\/p>\n<\/li>\n<li>\n<p align=\"left\"><span style=\"font-size: small;\"><strong>file (Filename) \u2014<\/strong> The exact filename of your <span style=\"font-family: Courier New, monospace;\">.opub<\/span> file.<\/span><\/p>\n<\/li>\n<\/ul>\n<h3 class=\"western\"><span style=\"color: #007670;\">Step 3: Refresh the Gallery<\/span><\/h3>\n<p class=\"western\">Reload Open Publisher and open the Publication Templates gallery. Your new template will automatically appear in the grid under the assigned category, complete with an auto-generated page size badge, and will load flawlessly when clicked.<\/p>\n<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"max-width: 100%; border-radius: 6px;\" src=\"https:\/\/github.com\/user-attachments\/assets\/ac28cc5b-ad6d-43b8-9ec8-2233c84e11a7\" alt=\"Open Publisher custom templates gallery\" width=\"731\" height=\"758\" \/><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Adding Custom Templates If you are self-hosting Open Publisher, you can add your own custom templates to the Publication Templates Gallery. Because templates use a modular architecture, you can add as many as you like without ever needing to modify the core JavaScript bundle. Step 1: Create your .opub File Create a new publication in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2403,"comment_status":"open","ping_status":"open","template":"","knowledgebase_cat":[28],"class_list":["post-2389","knowledgebase","type-knowledgebase","status-publish","has-post-thumbnail","hentry","knowledgebase_cat-templates"],"_links":{"self":[{"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/knowledgebase\/2389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/comments?post=2389"}],"version-history":[{"count":11,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/knowledgebase\/2389\/revisions"}],"predecessor-version":[{"id":2407,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/knowledgebase\/2389\/revisions\/2407"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/media\/2403"}],"wp:attachment":[{"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/media?parent=2389"}],"wp:term":[{"taxonomy":"knowledgebase_cat","embeddable":true,"href":"http:\/\/acr.floydcraft.co.uk\/openpublisher\/wp-json\/wp\/v2\/knowledgebase_cat?post=2389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}