Horje
Mason extends the Advanced Custom Fields Plugin to manage predefined Flexible Content Blocks in a single directory.

Noted That:

  • To install correctly this mason.zip.
  • Fisrt Download the mason.zip to your computer
  • Extract/Open mason.zip to Your Computer.
  • Then, Find readme.txt file inside mason.zip and Open readme.txt.
  • Now, Read the Requirements of this plugin. Which Wordpress Version and PHP Version are required to run this Plugin in Your Wordpress Site.
  • Then, Follow the the Tips Below.

Start the Tips:

1. First Download "mason.zip" Plugin to your Local Computer. (Click Download)

2. Then, Login to your "yourdomain.com/wp-admin" Dashboard.

/stack/wp/e1593231376d7d849d2-4597-4fa3-a6ff-1eca18f72aab.png

3. Then, Click on "Plugins" + "Add New" from left sidemenu of Dashboard.

/stack/wp/e1593231378Screenshot20.png

4. Now, Click on "Upload Plugin" button.

/stack/wp/e1593231380Screenshot-2019-4-2AddPluginsHorjeWordPress.png

 

5. Now, Browse "mason.zip" Downloaded plugin from your computer, Where you downloaded mason.zip According to Step – 1 Above then, click on "Install Now"

/stack/wp/e15931461531577025694plugin.png

6. Now, Click on "Active Plugin"

/stack/wp/e15932313830ca45529-bf73-4101-8178-53ae60ce549f.png

7. Then, See left sidemenu. "Mason" folder is added on left sidemenu. Now, Click on "Mason" folder.

   Noted that: If you do not see "Mason" folder on left sidemenu then, see at left sidemenu "Settings" or "Tools".

8. Now you configure yourself oR Watch video tutorial below about Mason Configurtions and Settings or How to work "Mason" in your WordPress site.

 

oR

After Activated Plugin According to Step-6 then,

  1. Go to "Plugins" + "Installed Plugin" from Wordpress Admin Panel Leftside Menu.
  2. or Direct go to: https://yourdomain/wp-admin/plugins.php
  3. Then, Find "Mason" Activated Plugin from Plugin List.
  4. Then, Click on "Settings" from Plugin that is Mason
  5. Now, Edit/Add/Config the setting and Click on "Save Changes" button,
WP Plugin Setting



Guide

The Module System in the Mason Plugin

Mason uses a custom made module system. We found we were redesigning the same design and functionality for parts of websites over and over – like a full width background video, or a carousel, or a location map. We were rewriting the code for the same “block” a couple times in one website. And then we’d write the same code for a similar block for another website. There clearly had to be a better way. A way where we could reuse the code within a site and borrow it from other sites. So we built our modules system.

A “module” to us is a block on a webpage that is used on multiple pages, or multiple places on the same page. Like a banner with a background image and an

<

h1> title tag. Or a two-column layout. A “module” is a section that has a very specific style and functionality. Some common modules we use are:

  • “accordion” – which is a list of rows, where each row has a title, and clicking on the title opens a box below the row with content. Imagine an FAQ page.
  • “media” – this is a full width banner block, with a background image or background video and text that overlays (and a filter that sets the opacity over the background image and a color filter over the background image)
  • “slider” – this is a carousel for images
    Before we started making “modules” we would build these using the Advanced Custom Fields (ACF) plugin, specifically the “flexible content field”.

You can see the tutorial here for those: https://www.advancedcustomfields.com/resour
ces/flexible-content/
Some blog posts about using flexible content fields if you haven’t used them:
http://www.amyhaywood.com/modular-wordpress-theming-flexible-content/
http://www.creativebloq.com/web-design/build-modular-content-systems-wordpress-41514680

The Mason Module System still uses the ACF plugin and the flexible content field, but we code it differently than you may have seen before.

If you look in /Mason/includes/modules you’ll see a sub directory with the name ‘generic_content_test’. This a self-contained “module”, containing the same file structure:

  • _modules.scss
  • functions.php
  • index.php
  • module.js
  • module_layout_acf_def.php
  • module-view.php
  • readme.txt

Let’s review these files.

module_layout_acf_def.php this is where you define your acf flexible content field. If you go into the ACF Plugin page in the admin section, you can create the acf fields you need there, and then from the admin->Custom Fields->Tools->Export Field Groups: you select the group you defined and click on the ‘Generate Export Code’ button. You can copy and paste from that output the fields you want to include. Please review an existing module_layout_acf_def.php file for the proper format. You are not adding the entire output from the Generate Export Code, but merely the flexible content definition.

functions.php this, like a WordPress theme, is your custom functions location. Here, you only need to create a function that will query the acf fields (or other data) and create an array of values to pass to the module-view.php (the template). Again, see an example for how this is done. The main goal is to put as much of your “logic” in this file – so that the module-view.php file is mostly HTML and easier to read. If you have javascript associated with this module (which would be located in the module.js file in this subdirectory), you need to enqueue it here.

module-view.php this is the template for your module. The available variables should be listed in the comments at the top of the file. It is permissible to write php logic here (and often necessary), but it should be as little as possible. Basically, only use php to check if the value exists before printing out the HTML.

_modules.scss You will add your styling for this module here.


content, flexible, blocks, single, directory, predefined, manage, advanced, extends, custom,

Name

Reffered: https://wordpress.org/

Share on: