Published on 04/04/2018 Published by amit
Understanding Awesome Core
The Awesome Core collection is used to configure and register defaults for Awesome Enterprise powered websites. Here are some of the slugs that are needed for Awesome based websites to work properly.
- register: If you want to register the custom post type, menu positions, taxonomies, etc. then you can use this. It is always executed at WordPress init hook.
- init: If you want to run something only in the frontend during init hook you can use this.
- backend-init: if you want to run something during admin_init hook you can put that code within.
- services: It is used to register various services that will be used across the website. To register a service you have to create a ‘services ‘ array as shown below
XHTML12[services.add db service_label='DB Services' post_type='db_service' desc='database services' /][services.add common service_label='Common Service' post_type='common_service' desc='Common services'/]
Eg db is the slug of the service, label is used for display, post_type is used to map the service to a post type and desc is just used to describe the purpose of the service being registered. Currently, you have to create the post types yourself. Awesome enterprise will not create them for you.
- scripts: If you need to run something during wp_head hook of WordPress you can use this. This is ideally suited for scripts and styles. You can add app specific scripts and styles to the app config.
- footer-scripts: If you need to run something when WordPress fires wp_footer hook then this is for you. It is currently global.
- header: This is used by monomyth to show the common header for the theme, it can be overridden at app level to show the different header.
- footer: This is used by monomyth to show common footer for the theme, it can be overridden at app level to show different footer.
- settings: This slug is used to hold all the global settings of the website. The settings are stored in custom fields as meta_key and value. They are available via [env.settings meta_key] and [settings.meta_key]
- single-content-layout: This module is used to give default single-page layout, you can access current post object using [current_post.<property>] , It can be overridden at the app level, by creating the same slug in app config.
- apphelp-content-layout: It is used to create the layout for apps help module, it is used for all the apps. It has been removed and not used any more in Awesome Enterprise 3.0
- archive-content-layout: It is used to give the layout for various archive pages, like taxonomy, date, tags, author pages. It can be overridden by the app.
- $post_type . ‘-archive-content-layout: we can also have specific post-type archive layout if desired.
- blog-content-layout: It is used by monomyth theme to show the blog post landing page layout. It is used within home.php file.
- layout: This slug is used to create the default layout for all the app pages. This is the fall-back for page layouts. It is equivalent to custom-layout of awesome studio.
- gutenberg-blocks: This support was added from 1.3.5, It is used to register all the awesome Gutenberg blocks. It also requires ACF PRO plugin.
- content-types: It is used to register Content Types. It’s was introduced in Awesome Enterprise 3.0 .
- less-variables: With Awesome Enterprise 3.0, we moved registration the registration of Less Variables to this module.
XHTML1234[register.less_variables]@brand-primary: [module.get skin.brand-primary default='#ff5722' /];@brand-success: [module.get skin.brand-success default='#8ec63f' /];[/register.less_variables]