diff --git a/app/models/post/template_field.rb b/app/models/post/template_field.rb index 540f09bb..abb4dae8 100644 --- a/app/models/post/template_field.rb +++ b/app/models/post/template_field.rb @@ -22,6 +22,10 @@ class Post contents.dig('title') if complex? end + def subtitle + contents.dig('subtitle') if complex? + end + # Obtiene el valor def value complex? ? contents.dig('value') : contents diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index a74416c1..ce0e31b8 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -119,6 +119,8 @@ - next unless type = template.type - if template.title.present? %h1{id: template.title.tr(' ', '_').titleize}= template.title + - if template.subtitle.present? + %p= template.subtitle - value = @post.new? ? template.values : @post.get_front_matter(template.key) .form-group = label_tag "post_#{template}", id: template do