diff --git a/frappe/print/page/print_format_builder/print_format_builder.js b/frappe/print/page/print_format_builder/print_format_builder.js
index 0feb21bfac..fac5e38589 100644
--- a/frappe/print/page/print_format_builder/print_format_builder.js
+++ b/frappe/print/page/print_format_builder/print_format_builder.js
@@ -198,10 +198,12 @@ frappe.PrintFormatBuilder = Class.extend({
this.setup_add_section();
this.setup_edit_heading();
this.setup_field_settings();
+ this.setup_html_data();
},
prepare_data: function() {
this.print_heading_template = null;
this.data = JSON.parse(this.print_format.format_data || "[]");
+ this.fields_dict = {};
if(!this.data.length) {
// new layout
this.data = this.meta.fields;
@@ -212,6 +214,15 @@ frappe.PrintFormatBuilder = Class.extend({
this.data = this.data.splice(1);
}
}
+
+ if(!this.print_heading_template) {
+ // default print heading template
+ this.print_heading_template = '
+
{{ field.options || me.get_no_content() }}
{% } else { %}
{{ field.label }}
diff --git a/frappe/print/page/print_format_builder/print_format_builder_layout.html b/frappe/print/page/print_format_builder/print_format_builder_layout.html
index 0d9c9293a7..6c6d567b56 100644
--- a/frappe/print/page/print_format_builder/print_format_builder_layout.html
+++ b/frappe/print/page/print_format_builder/print_format_builder_layout.html
@@ -1,28 +1,24 @@
-
- {%= __("Drag elements from the sidebar to add. Drag them back to trash.") %}
-
-
-
- {% for(var i=0; i < data.length; i++) { %}
- {%= frappe.render_template("print_format_builder_section",
- {section: data[i], me:me}) %}
- {% } %}
-
-
+
+ {%= __("Drag elements from the sidebar to add. Drag them back to trash.") %}
+
+
+
+ {% for(var i=0; i < data.length; i++) { %}
+ {%= frappe.render_template("print_format_builder_section",
+ {section: data[i], me:me}) %}
+ {% } %}
+
+