Page and Menu Controller – Tutorial

Guest User Restricted Pages

Below is the an example of how to use plugin for restricting/hiding pages from guest users. Pages which are restricted are also excluded from search.
i.e. Only logged in user can only see these pages.

Click on Page Rules from left menu or from Dashboard. Page Rules list page will be displayed as shown below. Click on + Page Rule button, Add Page will be displayed.

Provide appropriate values for below fields.

Rule Name : Page Rule name and should be unique.
ex. Login User Pages

Description : Appropriate description for your rule.

Status : This feature is useful if you would like to deactivate or activate rule.

Logical Rule : This select drop down is used to select any existing logical rule. If you would like to create new logical rule, click on Next button.

Select Pages : Pages we would like to hide.
ex : In our example Add Manager and Cart pages

Select Action: Action would like to perform.
In our use case Hide Page
Plugin support seven different actions:

  1. Append Content to Page.
  2. Append Content with image back ground.
  3. Append Image to Page.
  4. Append Third-Party short code.
  5. Hide Page
  6. Replace Page content.
  7. Soft Page Hide.

Redirect URL : This URL is used to redirect to the specified URL is any one tries to access the hidden page directly.

Content Body : The content that should be shown if the accessed directly.
ex. This page is not only available for subscriber role users.

After entering the above details, Click on Next button, Add Logical Rule page is displayed. In this page we define the rule for hiding pages. If the rule is satisfied, pages/Menus will be hidden.

Provide appropriate values for below fields.

Rule Name : Logical Rule name and should be unique.
ex.Login User Role.

Description : Appropriate description for your rule.

Action Hook : Hook will be invoked if the rule satisfied, useful for developers. (Not a mandatory field)

Add Criteria : Used to define on what condition/criteria we want to hide pages. In our sample, we would like to restrict pages from Guest Users. So the criteria should be on User Profile. Click on the image to view the rule.

We can define a logical rule using 12 categories like User Role, Geo location, Date and Time etc and 28 sub categories like (UserId, Country, City, Month, Mobile etc). Click here to view the list of categories and sub-categories for defining the rule.

So the rule is defined using User Profile criteria, Guest User sub-criteria and with equal condition, click on images to view in full screen.

After defining the Logical Rule, click on Save Rule. This will create a Page Rule.

Pages by User Role

Below is the an example of how to use plugin for hiding pages from subscriber role and guest users.

Click on Page Rules from left menu or from Dashboard. Page Rules list page will be displayed as shown below. Click on + Page Rule button, Add Page will be displayed.

Provide appropriate values for below fields.

Rule Name : Page Rule name and should be unique.
ex. Subscriber Pages

Description : Appropriate description for your rule.

Status : This feature is useful if you would like to deactivate or activate rule.

Logical Rule : This select drop down is used to select any existing logical rule. If you would like to create new logical rule, click on Next button.

Select Pages : Pages we would like to hide.
ex : In Test Page 1 and Test Page 2

Select Action: Action would like to perform.
In our use case Hide Page
Plugin support seven different actions:

  1. Append Content to Page.
  2. Append Content with image back ground.
  3. Append Image to Page.
  4. Append Third-Party short code.
  5. Hide Page
  6. Replace Page content.
  7. Soft Page Hide.

Redirect URL : This URL is used to redirect to the specified URL is any one tries to access the hidden page directly.

Content Body : The content that should be shown if the accessed directly.
ex. This page is not only available for subscriber role users.

After entering the above details, Click on Next button, Add Logical Rule page is displayed. In this page we define the rule for hiding pages. If the rule is satisfied, pages/Menus will be hidden.

Provide appropriate values for below fields.

Rule Name : Logical Rule name and should be unique.
ex.Subscriber Role.

Description : Appropriate description for your rule.

Action Hook : Hook will be invoked if the rule satisfied, useful for developers. (Not a mandatory field)

Add Criteria : Used to define on what condition/criteria we want to hide pages. In our sample, we would like to hide pages for subscriber role and for Guest Users. So the criteria should be User Role and User Profile. Click on the image to view the rule.

We can define a logical rule using 12 categories like User Role, Geo location, Date and Time etc and 28 sub categories like (UserId, Country, City, Month, Mobile etc). Click here to view the list of categories and sub-categories for defining the rule.

So the rule is defined using User Role and User Profile criteria, click on images to view in full screen.

After defining the Logical Rule, click on Save Rule. This will create a Page Rule and list the rule details as shown below.

 

Generating dynamic shortcode.

Below is the an example of how to use plugin for generating dynamic shortcode and it’s usage. Generating dynamic shortcode is the one of the special features of the plugin. which no plugin provides. Not just generating the shortcode but we can also apply the rules on the generated shortcode for example this shortcode should be displayed only for a certain user role or country etc.

Plugin provide two ways of generating shortcodes.

  • Generate dynamic shortcode for images.
  • Generate dynamic shortcode for any content.

Below is a usecase of generating shortcode of a baby image and applying rule of displaying only for the author role.

Below is the an example of how to use plugin for showing user role specific pages.

Click on Page Rules from left menu or from Dashboard. Page Rules list page will be displayed as shown below. Click on + Page Rule button, Add Page will be displayed.

Provide appropriate values for below fields.

Rule Name : Page Rule name and should be unique.
ex. Baby Image shortcode

Description : Appropriate description for your rule.

Status : This feature is useful if you would like to deactivate or activate rule.

Logical Rule : This select drop down is used to select any existing logical rule. If you would like to create new logical rule, click on Next button.

Select Pages : Pages we would like to hide.
ex : In our use case ShortcodeTest

Select Action: Action would like to perform.
In our use case Hide Page
Plugin support seven different actions:

  1. Append Content to Page.
  2. Append Content with image back ground.
  3. Append Image to Page.
  4. Append Third-Party short code.
  5. Hide Page
  6. Replace Page content.
  7. Soft Page Hide.

In our usecase it is “Append Image to Page” and in Code”

Location : Indicate which position would like to display image.
Location supports below options:

  • Bottom of the Page.
  • Top of the Page.
  • Generate shortcode.
  • Show as dialog.

In our usecase select “Generate Short”.

ShortCode_PageEdit

Image : This option will list all the images in the wordpress.

Image Size : Supports Full, Large, Medium and Thumbnail images.

Click on next button, will display the Logical Rules section.

Provide appropriate values for below fields.

ShortCode_LogicaRule_Author_Role

Rule Name : Logical Rule name and should be unique.
ex.Subscriber Role.

Description : Appropriate description for your rule.

Action Hook : Hook will be invoked if the rule satisfied, useful for developers. (Not a mandatory field)

Add Criteria : Used to define on what condition/criteria we want to hide pages. In our sample, we would like to hide pages if the user role other than subscriber and for Guest User.

We can define a logical rule using 12 categories like User Role, Geo location, Date and Time etc and 28 sub categories like (UserId, Country, City, Month, Mobile etc). Click here to view the list of categories and sub-categories for defining the rule.

So the rule is defined using User Role, click on images to view in full screen.

After defining the Logical Rule, click on Save Rule. This will create a Page Rule and list the rule details as shown below. Click on the image to view in full screen.

ShortCode_PageRulesList

Copy the generated shortcode ,

Go to the pages which you have selected in page rule and add the shortcode, which is similar to adding any shortcode as shown below.

ShortCode_AppendToPage

Demo  Credentials.

User name : auth
Password : bis123$

http://rulesengine.in/wp-login.php

Login and click on “SHORTCODE TEST” Page, Baby image will be display.
Now use other krish user credential and login and verify the same page, short code is not generated.

Demo  Credentials.

User name : krish
Password : bis123$

http://rulesengine.in/wp-login.php