---json { "description": "A frontmatter can be added to your pages to store your metadata. This page shows you how to enable this functionality.", "page_id": "rgq4v5g81jbzju7rld2r7", "title": "How to add Frontmatter to your pages" } --- ====== ComboStrap Page Metadata - Front Matter ====== ===== About ===== ''Front Matter'' is a component that permits to [[docs:admin:replication|replicate]] the [[..:metadata:metadata|metadata]] into your page. This functionality is used when you want to: * move your pages and get the metadata in sync in other ComboStrap installation * get an history of the metadata modification * want to kept your short [[:docs:page:page_id|page id]] close to your page when using [[docs:page:url#permanent|permant url]] It borrows its name from the [[kb>markup:front-matter|front matter book]] The frontmatter is the [[wp>Single_source_of_truth|source of truth]] for ComboStrap. Any value in the frontmatter will take precedence over the [[docs:metadata:viewer|raw metadata]] or [[docs:analytics:database|internal database]] metadata. ===== Example ===== A frontmatter is a block located at the start of your page that: * starts with ''%%---json%%'' * contains a json document representing your metadata * end with ''%%---%%'' Example: ---json { "name":"Short Name", "title":"My Big title in the Search Engine Result Pages", "description":"That's the article that you want to read!" } --- ===== Replication ===== The frontmatter replication happens by default page by page when you [[docs:metadata:manager|submit the metadata manager form]]. * If you have just enabled the frontmatter in the configuration * And that you want to replicate the [[docs:metadata:metadata|managed metadata]] for all pages * You can call the ''metadata-to-frontmatter'' command of the [[docs:admin:cli|cli]]. cd $DOKUWIKI_HOME # optional (for farm) animal=animal-directory-name # command php ./bin/plugin.php combo metadata-to-frontmatter ===== Configuration ===== ==== enableFrontMatterOnSubmit ==== When the ''enableFrontMatterOnSubmit'' [[docs:app:configuration|configuration]], you will create a frontmatter when you submit the [[docs:metadata:manager|metadata manager form]]. By default, this functionality is disabled if the page does not have already a frontmatter.