Plugin info

Total downloads: 1,776
Active installs: 10
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 2
Last updated: 2/10/2022 (1420 days ago)
Added to WordPress: 7/18/2014 (11 years old)
Minimum WordPress version: 3.9
Tested up to WordPress version: 5.9.0
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 1420 days ago

20/100

Is Template Map abandoned?

Possibly abandoned (last update 1420 days ago).

Compatibility

Requires WordPress: 3.9
Tested up to: 5.9.0
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Mailto Templates
Rating 0.0/5 (0 reviews)Active installs 0
Template Kit – Import
Rating 3.5/5 (11 reviews)Active installs 300,000
Show Current Template
Rating 5.0/5 (71 reviews)Active installs 100,000
What The File
Rating 4.9/5 (882 reviews)Active installs 40,000

Description

Template Map is a utility plugin designed to make the creation and management of navigation elements in your custom theme that much easier. It abstracts the need to hard code post IDs and the like from your global and header navigation systems (if you choose to not use Menus) for instance.

For Example

Many times you may use something like the following to build your main site navigation:


That works great during initial development, and continues to hold up when you migrate to production en masse for the first time. But what about when you’re making subsequent updates and the post IDs in your development environment are different than those in production? You could take the time to sync the databases each and every time, but that’s a bit overkill. Here’s where Template Map comes in to play:


Template Map allows you to dynamically retreive your desired post ID based on the Page Template you told it to use. Page Template filenames rarely (if ever) change, so it’s the core concept of Template Map’s implementation. Everything works backwards from here.

Naturally this philosophy assumes your Page Template is used only once, it’s important to keep that in mind. Modern client sites often use unique Page Templates for the ‘parent’ pages of each site section.

Current Site Section

Template Map also makes it easier to determine whether the current page is within a site ‘section’ which is defined as a top level Page with a unique Page Template that has any number of child Pages and/or Custom Post Types within it. This is very useful when trying to set a ‘current’ state in your navigation, for example:


Based on the same principle you can use this utility method to properly orient yourself when outputting conditional classes contingent on the current page being within a ‘secton’ on your site.

Installation

  1. Upload templatemap to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Replace calls to get_permalink( 83 ) with get_permalink( TemplateMap()->get_id_from_template( 'template-about.php' ) ) where template-about.php is the Page you wish to link

Frequently Asked Questions

How do I define Custom Post Types within a section?

There’s a filter for that. template_map_post_types accepts two parameters, the second of which is the Page Template filename in question. You can conditionally return an array of CPT names that will be utilized when checking to see whether the current page is within the section in question.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.0.1

  • When using maybe_in_section you can pass a 2nd parameter to force a parent ID

1.0

  • Initial release