How to Generate List of Nested Pages?

This is an advanced shortcode that may not be suitable for everyone. You may need to consult with your developer or subscribe to the MPG Pro plan for adequate support.

Here's a short video showing how to generate a list of nested pages:

Generating nested pages allows you to dynamically generate a list of MPG URLs from another project. A perfect use case would be to generate lists of cities within a state. In the example below, the user had two MPG projects:

  • State – MPG project for generating state pages with project ID 18.
  • City – MPG project for generating city pages with project ID 17.

Both projects had a column called “mpg_country” which was used to match the data from both projects for the generation of the list.

  • mpg_match is the shortcode that is placed in the template of the State page.
  • current-project-id is the parameter indicating the ID of the project where the shortcode is inserted, in this case, it is ID 18.
  • search-in-project is the parameter indicating the ID of the project, which URLs the shortcode has to display. I.e. in this case this is cities template with ID 17.
  • current-header is the shortcode parameter that will be used to compare and match with the MPG project where URLs will be generated from
  • match-with is the shortcode parameter for which header to compare the current-header with.

You may now return any data along with static text from the other project between the  mpg_match and /mpg_match. This can be any mpg shortcode, you can generate lists of URLs, create URL tables, or even return images or static data.

[mpg_match current-project-id="18"  search-in-project-id="17"  current-header="mpg_country" match-with="mpg_country"]
      <a href="{{mpg_city}}">City: {{mpg_city}}</a> <br>
[/mpg_match]