Title: Template Map
Author: Jon Christopher
Published: <strong>18 Temmuz 2014</strong>
Last modified: 10 Şubat 2022

---

Eklentilerde ara

![](https://ps.w.org/template-map/assets/banner-772x250.jpg?rev=951721)

Bu eklenti, **WordPress’in son 3 ana dağıtımı ile test edilmemiş**. Artık bakımı
yapılmıyor veya desteklenmiyor olabilir ve WordPress’in daha güncel sürümleriyle
birlikte kullanıldığında uyumluluk sorunları olabilir.

![](https://s.w.org/plugins/geopattern-icon/template-map_d59f6f.svg)

# Template Map

 [Jon Christopher](https://profiles.wordpress.org/jchristopher/) tarafından

[İndir](https://downloads.wordpress.org/plugin/template-map.1.0.1.zip)

 * [Detaylar](https://tr.wordpress.org/plugins/template-map/#description)
 * [İncelemeler](https://tr.wordpress.org/plugins/template-map/#reviews)
 *  [Kurulum](https://tr.wordpress.org/plugins/template-map/#installation)
 * [Geliştirme](https://tr.wordpress.org/plugins/template-map/#developers)

 [Destek](https://wordpress.org/support/plugin/template-map/)

## Açıklama

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:

    ```
    <nav>
      <ul>
        <li>
          <a href="<?php echo get_permalink( 83 ); ?>">About</a>
        </li>
      </ul>
    </nav>
    ```

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:

    ```
    <nav>
      <ul>
        <li>
          <?php $about_page_id = TemplateMap()->get_id_from_template( 'template-about.php' ); ?>
          <a href="<?php echo get_permalink( $about_page_id ); ?>">About</a>
        </li>
      </ul>
    </nav>
    ```

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:

    ```
    <nav>
      <ul>
        <li class="<?php if( TemplateMap()->maybe_in_section( 'template-about.php' ) ) : ?> current<?php endif; ?>">
          <?php $about_page_id = TemplateMap()->get_id_from_template( 'template-about.php' ); ?>
          <a href="<?php echo get_permalink( $about_page_id ); ?>">About</a>
        </li>
      </ul>
    </nav>
    ```

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.

## Yükleme

 1. Upload `templatemap` to the `/wp-content/plugins/` directory
 2. Eklentiyi WordPress ‘Eklentiler’ bölümünden etkinleştirin
 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

## SSS

### 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.

## İncelemeler

Bu eklenti için herhangi bir değerlendirme bulunmuyor.

## Katkıda Bulunanlar ve Geliştiriciler

“Template Map” açık kaynaklı yazılımdır. Aşağıdaki kişiler bu eklentiye katkıda 
bulunmuşlardır.

Katkıda bulunanlar

 *   [ Jon Christopher ](https://profiles.wordpress.org/jchristopher/)

[“Template Map” eklentisini dilinize çevirin.](https://translate.wordpress.org/projects/wp-plugins/template-map)

### Geliştirmeyle ilgilenir misiniz?

[Kodu görüntüleyin](https://plugins.trac.wordpress.org/browser/template-map/), [SVN deposuna](https://plugins.svn.wordpress.org/template-map/)
göz atın ya da [RSS](https://plugins.trac.wordpress.org/log/template-map/?limit=100&mode=stop_on_copy&format=rss)
ile [geliştirme günlüğüne](https://plugins.trac.wordpress.org/log/template-map/)
abone olun.

## Değişiklik Kaydı

#### 1.0.1

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

#### 1.0

 * İlk sürüm

## Meta

 *  Sürüm **1.0.1**
 *  Son güncelleme **4 yıl önce**
 *  Etkin kurulumlar **10+**
 *  WordPress sürümü ** 3.9 veya üstü **
 *  Test edilen sürüm **5.9.0**
 *  Dil
 * [English (US)](https://wordpress.org/plugins/template-map/)
 * Etiketler
 * [link](https://tr.wordpress.org/plugins/tags/link/)[template](https://tr.wordpress.org/plugins/tags/template/)
 *  [Gelişmiş görünüm](https://tr.wordpress.org/plugins/template-map/advanced/)

## Puanlar

Henüz inceleme gönderilmedi.

[Your review](https://wordpress.org/support/plugin/template-map/reviews/#new-post)

[Tüm değerlendirmeleri görün](https://wordpress.org/support/plugin/template-map/reviews/)

## Katkıda bulunanlar

 *   [ Jon Christopher ](https://profiles.wordpress.org/jchristopher/)

## Destek

Söyleyeceğiniz bir şey mi var? Yardım mı lazım?

 [Destek forumunu görüntüle](https://wordpress.org/support/plugin/template-map/)

## Bağış yap

Bu eklentinin geliştirilmesini desteklemek ister misiniz?

 [ Bu eklentiye bağış yap ](http://mondaybynoon.com/donate/)