{"id":212,"date":"2021-02-16T14:46:05","date_gmt":"2021-02-16T13:46:05","guid":{"rendered":"https:\/\/hoyre.no\/dokumentasjon\/?post_type=teft-wiki&#038;p=212"},"modified":"2021-02-17T12:56:30","modified_gmt":"2021-02-17T11:56:30","slug":"set-up-local-branch-site","status":"publish","type":"teft-wiki","link":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/","title":{"rendered":"Generate local branch site"},"content":{"rendered":"\n<p>Local branch sites are generated automatically based on data from Winorg.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fetch site data from Winorg<\/h2>\n\n\n\n<p>Data is fetched from Winorg using the GetAssociations_v4 webservice.<\/p>\n\n\n\n<p>A branch is saved to WordPress as as post of the &laquo;local-branch&raquo; post type.<\/p>\n\n\n\n<pre class=\"wp-block-verse\">WP CLI task: <strong>winorg-sync-associations<\/strong><\/pre>\n\n\n\n<p>The task will fetch Level 3, 4 and 5 associations and a few associations that are specified by actorid. If the branch exist, data is updated. If the branch is new, a new post will be created.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create new site based on site data<\/h2>\n\n\n\n<p>A new subsite can be created based on data from the local-branch post type.<\/p>\n\n\n\n<p>WP CLI task: <strong>hoyre-generate-branch-site<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> Usage: wp hoyre-generate-branch-site &lt;association actor id> &lt;cta_id_before_news> &lt;cta_id_after_news><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Example:\nwp hoyre-generate-branch-site 11111111 7139 7141<\/code><\/pre>\n\n\n\n<p>Association actor ID is found as the meta field <strong>ActorId<\/strong> on the post.<\/p>\n\n\n\n<p><strong>CTA ID<\/strong> refers to a post of the the CTA post type. These are the blocks placed on the front page before and after the news block. Currently the default ids are <strong>7139<\/strong> for pre-news and <strong>7141<\/strong> for post-news.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"381\" height=\"359\" src=\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png\" alt=\"\" class=\"wp-image-215\" srcset=\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png 381w, https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image-300x283.png 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Templates<\/h2>\n\n\n\n<p>The page templates used when creating a new site is located in the folder \/tmp-import-data\/branches\/ in the repository.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Known issues<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use &#8211;skip-plugins=searchwp when generating the site if SearchWP is active on the site.<\/li><li>After new site is generated, check that the value of the post meta field hoyre_local_branch_blog_path starts with a &laquo;\/&raquo;<\/li><\/ul>\n","protected":false},"parent":0,"menu_order":0,"template":"","meta":{"teft_cards_image_url":"","teft_cards_custom_pretitle":"","teft_cards_image_id":0,"teft_cards_image_focal_point_x":0,"teft_cards_image_focal_point_y":0,"teft_cards_title":"","teft_cards_excerpt":"","teft_show_chapters":false,"footnotes":""},"teft-wiki-topic":[],"teft-wiki-audience":[],"class_list":["post-212","teft-wiki","type-teft-wiki","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Generate local branch site - Dokumentasjon<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"nb_NO\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generate local branch site - Dokumentasjon\" \/>\n<meta property=\"og:description\" content=\"Local branch sites are generated automatically based on data from Winorg. Fetch site data from Winorg Data is fetched from [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/\" \/>\n<meta property=\"og:site_name\" content=\"Dokumentasjon\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-17T11:56:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Ansl. lesetid\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minutt\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/\",\"url\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/\",\"name\":\"Generate local branch site - Dokumentasjon\",\"isPartOf\":{\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#website\"},\"image\":{\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png\",\"datePublished\":\"2021-02-16T13:46:05+00:00\",\"dateModified\":\"2021-02-17T11:56:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#breadcrumb\"},\"inLanguage\":\"nb-NO\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#primaryimage\",\"url\":\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png\",\"contentUrl\":\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Til hoyre.no\",\"item\":\"https:\/\/hoyre.no\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Home\",\"item\":\"https:\/\/hoyre.no\/dokumentasjon\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Generate local branch site\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#website\",\"url\":\"https:\/\/hoyre.no\/dokumentasjon\/\",\"name\":\"Dokumentasjon\",\"description\":\"Bare enda et H\u00f8yres nettsteder-nettsted\",\"publisher\":{\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#organization\"},\"inLanguage\":\"nb-NO\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#organization\",\"name\":\"Dokumentasjon\",\"url\":\"https:\/\/hoyre.no\/dokumentasjon\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2020\/07\/dokumentasjon-logo.svg\",\"contentUrl\":\"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2020\/07\/dokumentasjon-logo.svg\",\"width\":821,\"height\":216,\"caption\":\"Dokumentasjon\"},\"image\":{\"@id\":\"https:\/\/hoyre.no\/dokumentasjon\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Generate local branch site - Dokumentasjon","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"nb_NO","og_type":"article","og_title":"Generate local branch site - Dokumentasjon","og_description":"Local branch sites are generated automatically based on data from Winorg. Fetch site data from Winorg Data is fetched from [&hellip;]","og_url":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/","og_site_name":"Dokumentasjon","article_modified_time":"2021-02-17T11:56:30+00:00","og_image":[{"url":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Ansl. lesetid":"1 minutt"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/","url":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/","name":"Generate local branch site - Dokumentasjon","isPartOf":{"@id":"https:\/\/hoyre.no\/dokumentasjon\/#website"},"image":{"@id":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#primaryimage"},"thumbnailUrl":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png","datePublished":"2021-02-16T13:46:05+00:00","dateModified":"2021-02-17T11:56:30+00:00","breadcrumb":{"@id":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#breadcrumb"},"inLanguage":"nb-NO","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/"]}]},{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#primaryimage","url":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png","contentUrl":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2021\/02\/image.png"},{"@type":"BreadcrumbList","@id":"https:\/\/hoyre.no\/dokumentasjon\/wiki\/set-up-local-branch-site\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Til hoyre.no","item":"https:\/\/hoyre.no"},{"@type":"ListItem","position":2,"name":"Home","item":"https:\/\/hoyre.no\/dokumentasjon\/"},{"@type":"ListItem","position":3,"name":"Generate local branch site"}]},{"@type":"WebSite","@id":"https:\/\/hoyre.no\/dokumentasjon\/#website","url":"https:\/\/hoyre.no\/dokumentasjon\/","name":"Dokumentasjon","description":"Bare enda et H\u00f8yres nettsteder-nettsted","publisher":{"@id":"https:\/\/hoyre.no\/dokumentasjon\/#organization"},"inLanguage":"nb-NO"},{"@type":"Organization","@id":"https:\/\/hoyre.no\/dokumentasjon\/#organization","name":"Dokumentasjon","url":"https:\/\/hoyre.no\/dokumentasjon\/","logo":{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/hoyre.no\/dokumentasjon\/#\/schema\/logo\/image\/","url":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2020\/07\/dokumentasjon-logo.svg","contentUrl":"https:\/\/hoyre.no\/content\/uploads\/sites\/2\/2020\/07\/dokumentasjon-logo.svg","width":821,"height":216,"caption":"Dokumentasjon"},"image":{"@id":"https:\/\/hoyre.no\/dokumentasjon\/#\/schema\/logo\/image\/"}}]}},"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Dokumentasjon","distributor_original_site_url":"https:\/\/hoyre.no\/dokumentasjon","push-errors":false,"_links":{"self":[{"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki"}],"about":[{"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/types\/teft-wiki"}],"version-history":[{"count":6,"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki\/212\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki\/212\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"teft-wiki-topic","embeddable":true,"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki-topic?post=212"},{"taxonomy":"teft-wiki-audience","embeddable":true,"href":"https:\/\/hoyre.no\/dokumentasjon\/wp-json\/wp\/v2\/teft-wiki-audience?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}