Download the PHP package helsingborg-stad/municipio without Composer
On this page you can find all versions of the php package helsingborg-stad/municipio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helsingborg-stad/municipio
More information about helsingborg-stad/municipio
Files in helsingborg-stad/municipio
Package municipio
Short Description A bootstrap theme for creating municipality sites.
License MIT
Informations about the package municipio
Municipio 3
Download theme.
To download a complete out of the box working plugin without the need to compile or fetch dependencies.
Go here and download the full-release.zip
from the latest version.
Getting started
It is recommended to install the bundled version of municipio trough our build management repository. This can be found here.
To get started you'll need to install the required npm and composer packages. To install these components you will need to have Node.js and Composer installed on your system.
Dependencies
Municipio requires ACF PRO.
Coding standards
For PHP, use PSR-2 and PSR-4 where applicable.
Gulp
You can use Gulp to compile, concatenate and minify SASS and JavaScript. The compiling of SASS will also automatically add vendor-prefixes where needed.
To compile both js and sass and start the "watch" task run the following command from the theme directory:
We added support for webpack
Webpack is a bit faster than gulp. So if you prefer to use webpack instead of gulp, just run the following command:
or just for a single build:
NPM scripts
- watch: Run webpack in watch mode. To be used when working on client side code like scss,js,ts...
- build:dev: Build assets with the development flag.
- build: Build assets for production.
- i18n:update: Updates languages/municipio.pot and languages/sv_SE.po from source files. Run this when translatable strings have been added/updated. Requires wp-cli.
- i18n:build: Updates languages/municipio.mo .po file. Run this when changes have been made to the corresponding .po file. Requires wp-cli.
Composer
You can install composer dependencies with.
Composer scripts
Constants
Block author pages
Author pages is blocked by default. To "unblock" add the following constant to wp-config (or other suitable place).
Load styleguide from a different host
Constants for setting the base URI to the styleguide. Useful for third-party sites.
Load specific version of styleguide
Constants that lock version of the styleguide. Comes in handy when you want to enshure maximum stability of a site.
Load specific developement version of styleguide
Constant that load local verrsion of the styleguide.
CSS class in BEMIT style for theme name
Constant that contains the current theme name in BEM format. Usable when you wnat to connect component styling directly to the theme.You cannot change this.
Actions
Municipio/blog/post_info
Blog post info header (single)
-
- The post object
Municipio/share_post/recipients
Do action on sharing post by email, e.g. send a notification
-
- User object for the sender
-
- List with e-mail addresses
Municipio/comment/save_like
Do action on comment like
-
- Comment object
-
- Current user ID
-
- True if a new like is created. False if it's removed
Filters
Municipio/Template/viewData
-
- The view data that is passed to filter.
Modifiers
-
- The view data that is passed to filter.
-
- The post type slug.
-
- The archive template name.
Deprecated:
Municipio/controller/base/view_data
Municipio/blade/data
Municipio/Controller/Archive/Data
Municipio/viewData
Municipio/theme/key
Filters the theme/styleguide asset key.
-
- The key of the styleguide theme
Municipio/author_display/name
Set the name of the author display
-
- Default name
-
- The ID of the user
Municipio/author_display/title
Set the title label for the author name display
-
- Default title
Municipio/ajax_url_in_head
Set the ajax_url in the
-
- Default ajax url
Municipio/favicon_sizes
Add sizes to theme options for favicon
-
- Default favicon sizes
Municipio/favicon_tag
Add sizes to theme options for favicon
-
- The HTML tag(s)
-
- The icon data
Municipio/header_grid_size
Applied to classes string for header sizes.
- -
Municipio/mobile_menu_breakpoint
Applied to classes string for mobile hamburger menu breakpoint.
-
- The default site name
Municipio/logotype_text
Applied to the text that displays as the logo when now logotype image is uploaded in theme options.
-
- The default site name
Municipio/logotype_class
Applied to the logotype class attirbute
-
- Default class(es)
Municipio/logotype_tooltip
Applied to the logotype class attirbute
-
- Default tooltip text
Municipio/blade/template_types
Applied to the list of Blade template types.
-
- Dafault Blade template types
Municipio/search_result/…
Multiple filters applied to the contents of a search result
-
- The content of the variable
-
- Post object
Municipio/search_form/…
Filters applied to the search form
-
- The content of the variable
Municipio/archive/sort_keys
Modify the avaiable sorting keys for archives
-
- The keys
-
- The post type
Municipio/archive/date_filter
Modify the date filter WHERE clause
-
- The sql WHERE clause
-
- The "from" date from querystring
-
- The "to" date from querystring
Municipio/Breadcrumbs
Show/hide (true/false) breadcrumbs
-
- True or false (show or hide)
Municipio/Breadcrumbs/Items
Filter the items/links in the breadcrumb
-
- The breadcrumb items
Municipio/admin/editor_stylesheet
Change custom editor stylesheet
-
- The stylesheet url
Municipio/oembed/should_filter_markup
Decide if oembed markup should be filtered to HbgPrime video player (youtube and vimeo) or not.
-
- The resource url
-
- Id of the current post
Municipio/Menu/Vertical/EnabledSidebars
Dictates what sidebars that sould be active on the current page to show the vertical menu. Simple array containing the sidebar id's.
-
- An flat array with sidebar id's.
Municipio/archive/tax_query
Additional taxonomy queries.
-
- Holds the taxonomy query.
-
- Current query object.
Municipio/taxonomy/tag_style
Adds custom style to taxonomy labels.
-
- Custom CSS.
-
- The term.
-
- Taxonomy.
Municipio/Menu/Vertical/Items
Items that should be visible in the vertical navigation menus. Represented as dots with hover-labels.
-
- An array with items representing links.
Municipio/ContentType/schemaParams
Modify the schema parameters for a content type. This filter is applied to the array of schema parameters associated with a content type, allowing for the extension or modification of the structured data (schema.org) attributes for that content type.
@param array $schemaParams
- The default schema parameters for the content type.@param string $contentTypeKey
- The key identifying the content type.
Municipio/Controller/SingularContentType/listing
Modifies the listing array for the Place content type by appending location-related list items. This allows for the inclusion of additional information such as street name or a Google Maps link directly within the listing display.
@param array $listing
- The existing listing array that will be modified.@param array $fields
- The fields associated with the post, used to extract location information.
REST routes
The following REST API routes are available from the theme.
Returns html for the
-
- Path to the blade view to be rendered. Appended to the route.
-
- Data to be passed to the view.
Example usage
Dev mode
To load assets from local styleguide. Set contant DEV_MODE to "true"
Theme fonts
Municipio is integrated with google web-fonts. It enables smart loading of fonts preventing invisible fonts using Google & Adobe webfont loader.
Version 2.0
The goal of version 2.0 is to restructure the theme frontend and move towards the BEM (IT) standard for markup. More filters will be added in a automatic manner, mutch like ACF doe's it. These will for now, be documented below.
Deprecated functionality (notice phase)
Version 2.0 will introduce some warnings aboute the removal of some prevoius functionality. According to plan, this functionality will be actually be removed in version 3.0. Functions that will be removed in 3.0 are.
- Gravitiforms optimizations
- Honeypot functionality for comments (this will be moved to separate plugin). Will also include google recaptcha.
- Contact widget (replacement avabile in modularity)
- RichText Widget (replacement embedded in core)
- PostType & Taxonomy creator (move to plugin)
- Upload filters (move to plugin)
Filters
Deprecated filters
- HbgBlade/data replaced with Municipio/viewData
- Municipio/ajax_url_in_head replaced with Municipio/ajaxUrl
- Modularity/CoreTemplatesSearchPaths
Blade view filter
All variables sent (created) in a controller will automatically go trough a filter named with the variable key.
Global view filter
You may prefer to get a full array of everything sent to a view. After the filter above has run, a global filter will be applied. This replaces the old filter.
Constants
MUNICIPIO_FRAGMENT_CACHE - Set to false to remove fragment cache.
Theme view structure
PHP Tests
Municipio uses PHPUnit for unit testing. For mocking and stubbing we use WP_Mock. This means that you can use WP_Mock, Mockery(since this is a wrapper for WP_Mock) and PHPUnit_MockObject for mocking and stubbing.
PHPUnit Tests file structure
All tests are stored in the tests/phpunit/tests
folder. The file structure should mirror the file structure of the theme. The file name should be the same as the file you want to test. For example, if you want to test the file src/Controller/Base.php
you should create the file tests/phpunit/tests/Controller/Base.php
. To avoid having too large test files, you can instead create a folder with the same name as the file you want to test and put the test files inside. Please note that for separating files by which class function you are testing, you should name the file e.g. Base.functionName.php
.
Running PHPUnit tests
Run composer test
in the terminal.
Running PHPUnit tests with code coverage
Run composer test:coverage
in the terminal. This will generate a code coverage report in the tests/phpunit/.coverage
folder.
Image compression
Municipio supports image compression with shortpixel. This will enque a cronjob with a slight delay to compress newly uploaded images. Simpley define SHORTPIXEL_API_KEY constant in your config file and that's it!
Compression level will be medium/glossy for high quality photos.
Tested with support from BrowserStack
This software is tested with the awesome tools from Browserstack.
All versions of municipio with dependencies
composer/installers Version ^1.0
symfony/polyfill-mbstring Version 1.17.0
helsingborg-stad/acf-export-manager Version >=1.0.0
pragmarx/ia-arr Version ^7.3
symfony/polyfill-php80 Version ^1.27
dompdf/dompdf Version ^2.0.4
spatie/schema-org Version ^3.9
helsingborg-stad/wpservice Version ^2.0
helsingborg-stad/acfservice Version ~0.4