PHP code example of helsingborg-stad / municipio

1. Go to this page and download the library: Download helsingborg-stad/municipio library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

helsingborg-stad / municipio example snippets


do_action('Municipio/author_display/name', $post);

do_action('Municipio/share_post/recipients', $user, $recipients);

do_action('Municipio/comment/save_like', $comment, $userId, $create);

apply_filters('Municipio/Template/viewData', $viewData);

apply_filters('Municipio/Template/single/viewData', $viewData, $postType);
apply_filters('Municipio/Template/archive/viewData', $viewData, $postType, $template);
apply_filters("Municipio/Template/{$postType}/viewData", $viewData);
apply_filters("Municipio/Template/{$postType}/single/viewData", $viewData);
apply_filters("Municipio/Template/{$postType}/archive/viewData", $viewData, $template);

apply_filters('Municipio/theme/key', $key);

apply_filters('Municipio/author_display/name', $name, $userId);

apply_filters('Municipio/author_display/title', $title);

apply_filters('Municipio/ajax_url_in_head', $ajax_url);

apply_filters('Municipio/favicon_sizes', $sizes);

apply_filters('Municipio/favicon_tag', $tag, $icon);

apply_filters('Municipio/header_grid_size', $classes);

apply_filters('Municipio/mobile_menu_breakpoint', $classes);

apply_filters('Municipio/logotype_text', $title);

apply_filters('Municipio/logotype_class', $classes);

apply_filters('Municipio/logotype_tooltip', $tooltip);

apply_filters('Municipio/blade/template_types', $types);

apply_filters('Municipio/search_result/date', $date, $post);
apply_filters('Municipio/search_result/title', $title, $post);
apply_filters('Municipio/search_result/excerpt', $excerpt, $post);
apply_filters('Municipio/search_result/permalink_url', $permalink_url, $post);
apply_filters('Municipio/search_result/permalink_text', $permalink_text, $post);

apply_filters('Municipio/search_form/action', $url);

apply_filters('Municipio/archive/sort_keys', $keys, $postType);

apply_filters('Municipio/archive/date_filter', $where, $from, $to);

apply_filters('Municipio/Breadcrumbs', $bool, get_queried_object())

apply_filters('Municipio/Breadcrumbs/Items', $items, get_queried_object());

apply_filters('Municipio/admin/editor_stylesheet', $url);

apply_filters('Municipio/oembed/should_filter_markup', true, $url, $postId);

apply_filters('Municipio/Menu/Vertical/EnabledSidebars', $sidebars);

apply_filters('Municipio/archive/tax_query', $taxQuery, $query);

apply_filters('Municipio/taxonomy/tag_style', $style, $term, $taxonomy);

apply_filters('Municipio/Menu/Vertical/EnabledSidebars', array(array('title' => 'Page section title', 'link' => '#anchorlink'));

add_filter('Municipio/ContentType/schemaParams', function($schemaParams, $contentTypeKey) {
    if ($contentTypeKey === 'yourContentTypeKey') {
        $schemaParams['newParameter'] = [
            'schemaType' => 'Text',
            'value' => 'Custom Value'
        ];
    }

    return $schemaParams;
}, 10, 2);

add_filter('Municipio/Controller/SingularContentType/listing', function($listing, $fields) {
    // Example modification to the listing array
    if (!empty($fields['custom_field'])) {
        $listing['custom_field'] = $fields['custom_field'];
    }

    return $listing;
}, 10, 2);

define('DEV_MODE', true);

define('WEB_FONT', 'Roboto'); //The google fonts name (without weights)
define('WEB_FONT_REMOTE', true); //Load font kit from cdn

apply_filters('Municipio/{{KEY}}', $var);

apply_filters('Municipio/viewData', $var);

$ cd [THEME-DIR]
$ php build.php

define('MUNICIPIO_STYLEGUIDE_URI', '//example.com/style/guide');
@param array $recipients
@param array $viewData
@param array $viewData
@param string $key
@param array $sizes
@param array $icon
@param array $classes
@param array $types
@param array $keys
@param array $items
@param array $sidebars
@param array $taxQuery
@param array $items
@param object $data