Custom Field Template plugin

Custom Field Template plugin
Custom Field Template plugin [ English Here ]

Custom Field Template plugin (カスタムフィールドテンプレート)というプラグインはカスタムフィールドの入力を支援するプラグインだ。あらかじめカスタムフィールドのテンプレートを登録しておくことでキーをその都度入力することなく、テンプレートにある項目の値を入力していくだけでよくなる。このCustom Field Templateというプラグインは、WordPressのカスタムフィールドを多用し、決まったデータを入力し公開しているようなサイトでは便利になるはずだ。

特徴

Custom Field Template pluginは、Joshua Sigarさんが開発したrc:custom_field_guiというプラグインをベースに改良を加えたものである。rc:custom_field_guiからの変更点は以下のとおり。

  • カスタムフィールドのテンプレートを登録し、投稿ページでテンプレートを切り替えられる。
  • カスタムフィールドのテンプレートは設定ページで登録する。iniファイルは使用しない。
  • 投稿だけでなくページでもカスタムフィールドを利用できる。
  • textareaでのtinyMCEのサポート

必須条件

WordPress 2.1 以上 (WordPress 2.2.3以降でしか確認してない。)

リリースヒストリー

  • 2008.11.20 Custom Field Template 0.6.2 リリース
    • バグフィックス
  • 2008.11.18 Custom Field Template 0.6.1 リリース
    • wpautop関数使用のオプション追加
  • 2008.11.17 Custom Field Template 0.6 リリース
    • typeにtextを追加。textとtextfieldは同じ。
    • カスタムフィールドのキーをラベルで置き換えできるオプションの追加。
    • バグフィックス
  • 2008.11.13 Custom Field Template 0.5.3 リリース
    • バグフィックス
  • 2008.11.05 Custom Field Template 0.5.2 リリース
    • バグフィックス
  • 2008.11.05 Custom Field Template 0.5.1 リリース
    • labelを追加
    • スタイルシートの採用
    • テンプレートが一つの時、セレクトボックスを表示しない
  • 2008.11.05 Custom Field Template 0.5.0 リリース
    • 設定ページにオプションリストを追加
    • radioにclearButtonを追加
    • textareaのサイズ保持
    • WordPress 2.7の対応
  • 2008.10.24 Custom Field Template 0.4.4 リリース
    • 複数checkboxの指定方法の追加
  • 2008.10.23 Custom Field Template 0.4.3 リリース
    • バグフィックス
  • 2008.10.22 Custom Field Template 0.4.2 リリース
    • バグフィックス
  • 2008.10.15 Custom Field Template 0.4.1 リリース
    • バグフィックス
  • 2008.10.15 Custom Field Template 0.4 リリース
    • 同一名のキーを持つフィールドを作成可
    • hideKeyオプションの追加。hideKey = true
    • メディアボタンはデフォルトではfalse。有効にする場合は、mediaButton = tureを追加。
  • 2008.10.08 Custom Field Template 0.3.2 リリース
    • バグフィックス
  • 2008.10.05 Custom Field Template 0.3.1 リリース
    • メディアボタンのサポート
  • 2008.09.05 Custom Field Template 0.2 リリース
    • tinyMCEのサポート
  • 2008.08.31 Custom Field Template 0.1.1 リリース
    • バグフィックス
  • 2008.08.30 Custom Field Template 0.1 リリース
    • 初公開

ダウンロード

Custom Field Templateプラグインのダウンロードは下記のリンクをクリック

または

インストール

  1. Custom Field Templateをダウンロードし、圧縮ファイルを解凍後、custom-field-templateディレクトリをwp-content/pluginsディレクトリにアップロードする。
  2. WordPressのプラグインページでCustom Field Templateを有効化する。
  3. 管理メニューの設定にある、カスタムフィールドテンプレートにて、テンプレートを登録する。

寄付

プラグインがお気に召しましたら、よろしければ下記のPaypalリンクよりご寄付ください。よろしくお願いいたします。

使用方法

ここではテンプレートの設定方法を記す。基本的にrc:custom_field_guiのものと同じ。まずはサンプルを見てもらおう。

CODE:
  1. [Plan]
  2. type = text
  3. size = 35
  4. label = Where are you going to go?
  5.  
  6. [Plan]
  7. type = textfield
  8. size = 35
  9. hideKey = true
  10.  
  11. [Favorite Fruits]
  12. type = checkbox
  13. value = apple # orange # banana # grape
  14. default = orange # grape
  15.  
  16. [Miles Walked]
  17. type = radio
  18. value = 0-9 # 10-19 # 20+
  19. default = 10-19
  20. clearButton = true
  21.  
  22. [Temper Level]
  23. type = select
  24. value = High # Medium # Low
  25. default = Low
  26.  
  27. [Hidden Thought]
  28. type = textarea
  29. rows = 4
  30. cols = 40
  31. tinyMCE = true
  32. mediaButton = true

まず、一つのセクションが一つのカスタムフィールドを指している。[]で囲まれているのがカスタムフィールドのキーである。typeには、textfield、checkbox、radio、select、textareaが指定できる。その他、size、value、default、rows、colsが適宜適用できるようになっている。とりあえず、色々試してみてほしい。

カスタムフィールドの入力は、投稿・ページの作成・編集時にテンプレートが表示されているはずなのでそこから行う。テンプレートはセレクトボックスで切り替えられるようになっている。

カスタムフィールドテンプレートのデザイン

デザインをCSSで変更できる(0.5.1より)。以下はデフォルトの設定。

CODE:
  1. #cft dl { clear:both; margin:0; padding:0; width:100%; }
  2. #cft dt { float:left; font-weight:bold; margin:0; text-align:center; width:20%; }
  3. #cft dt .hideKey { visibility:hidden; }
  4. #cft dd { float:left; margin:0; text-align:left; width:80%; }
  5. #cft dd p.label { font-weight:bold; margin:0; }

最後に

rc:custom_field_guiは古くからあるプラグインだが、すでに更新されておらず、もうひとつ使い勝手がよくなかった(設定を変更するのに一々iniファイルを編集する必要があった、など)。このプラグインを使用することで、データベース的に情報を整理するのにWordPressを利用している方の入力を少しでも楽にできればと思う。何か不具合とか、こういう機能を追加してほしい、というのがあればぜひ連絡してほしい。

Custom Filed Template Features

The Custom Field Template plugin adds the default custom fields on the Write Post/Page. The template format is almost same as the one of the rc:custom_field_gui plugin. The difference is following:

  • You can set any number of the custom field templates and switch the templates when you write/edit the post/page.
  • This plugin does not use the ini file for the template but set it in the option page of the plugin.

Requirement

WordPress 2.1 or higher

History

  • 2008.11.20 Custom Field Template 0.6.2 Release
    • Bugfix
  • 2008.11.18 Custom Field Template 0.6.1 Release
    • Adds wpautop function option
  • 2008.11.17 Custom Field Template 0.6 Release
    • Adds `type = text`, which is same as `type = textfield`
    • Adds an option to replace custom keys by labels
    • Bugfix
  • 2008.11.13 Custom Field Template 0.5.3 Release
    • Bugfix
  • 2008.11.05 Custom Field Template 0.5.2 Release
    • Bugfix
  • 2008.11.05 Custom Field Template 0.5.1 Release
    • Adds `label = blah-blah-blah`.
    • Adopts CSS design for custom field templates.
    • Displays the cft select box only if it has multiple templates.
  • 2008.11.05 Custom Field Template 0.5.0 Release
    • You can see the full option list in the setting page.
    • Adds `clearButton = true` in radios.
    • Keeps tinyMCE height after resizing the textarea and saving the post.
    • Compatible with WordPress 2.7 Beta 1
  • 2008.10.24 Custom Field Template 0.4.4 Release
    • Support for the other way of multiple checkboxes. See the example.
  • 2008.10.23 Custom Field Template 0.4.3 Release
    • Bugfix
  • 2008.10.22 Custom Field Template 0.4.2 Release
    • Bugfix
  • 2008.10.15 Custom Field Template 0.4.1 Release
    • Bugfix
  • 2008.10.15 Custom Field Template 0.4 Release
    • Support for multiple fields with the same key
    • Adds hideKey options. ex. hideKey = true
    • The default of media buttons is false. ex. mediaButton = true
  • 2008.10.08 Custom Field Template 0.3.2 Release
    • Bugfix
  • 2008.10.05 Custom Field Template 0.3.1 Release
    • Support for media buttons in the textarea
  • 2008.09.05 Custom Field Template 0.2 Release
    • Support for TinyMCE in the textarea
  • 2008.08.31 Custom Field Template 0.1.1 Release
    • Bugfix
  • 2008.08.30 Custom Field Template 0.1 Release

Download

or

Install

  1. Copy the `custom-field-template` directory into your `wp-content/plugins` directory
  2. Activate the plugin through the `Plugins` menu in WordPress
  3. Edit the options in `Settings` > `Custom Field Template`
  4. That's it! :)

Donation

If you liked this plugin, please make a donation via paypal! Any amount is welcome. Your support is much appreciated.

How to use

This is the example of the template. The template format is basically same as the one of the rc:custom_field_gui plugin.

CODE:
  1. [Plan]
  2. type = text
  3. size = 35
  4. label = Where are you going to go?
  5.  
  6. [Plan]
  7. type = textfield
  8. size = 35
  9. hideKey = true
  10.  
  11. [Favorite Fruits]
  12. type = checkbox
  13. value = apple # orange # banana # grape
  14. default = orange # grape
  15.  
  16. [Miles Walked]
  17. type = radio
  18. value = 0-9 # 10-19 # 20+
  19. default = 10-19
  20. clearButton = true
  21.  
  22. [Temper Level]
  23. type = select
  24. value = High # Medium # Low
  25. default = Low
  26.  
  27. [Hidden Thought]
  28. type = textarea
  29. rows = 4
  30. cols = 40
  31. tinyMCE = true
  32. mediaButton = true

Each section means one custom field. The key of the custom field is between []. The types are textfield, checkbox, radio, select, and textarea. There are some other arbitrary options: size, default, value, rows, and cols. Just do by trial and error.

CSS design for custom field templates

You can change the design of custom field templates by use of CSS in the setting page. This is the default CSS.

CODE:
  1. #cft dl { clear:both; margin:0; padding:0; width:100%; }
  2. #cft dt { float:left; font-weight:bold; margin:0; text-align:center; width:20%; }
  3. #cft dt .hideKey { visibility:hidden; }
  4. #cft dd { float:left; margin:0; text-align:left; width:80%; }
  5. #cft dd p.label { font-weight:bold; margin:0; }

Thanks.

このエントリをはてなブックマークに追加このエントリをdel.icio.usに追加このエントリをLivedoor Clipに追加このエントリをYahoo!ブックマークに追加このエントリをFC2ブックマークに追加このエントリをNifty Clipに追加このエントリをPOOKMARK. Airlinesに追加このエントリをBuzzurl(バザール)に追加このエントリをChoixに追加このエントリをnewsingに追加

« Top Level Categories Fixプラグイン
WordPress.orgのプラグインディレクトリに自作プラグインを登録する方法 »

関連記事

Trackback URL

Trackbacks (1)

Comments (59)

こんにちは、

翻訳ご言い訳マイ自動的に生成されます。

する方法はあるエディタが正常に機能するtinymceを取得するには、 “テキスト”
または”テキスト”セクションですか?

ありがとうございました。

Hello,

Please excuse my automatically generated translation.

Is there a way to get the TinyMCE editor to function in the “TEXTFIELD”
or “TEXTAREA” sections?

thank you.

Hi Kel,
Thanks, ok in English. This plugin does not support TinyMCE at present. However, I may add the TinyMCE editor in the next version. Let me have some time. Thanks.

great! - thanks for the plugin. I came across this post, referring to the old Rhymed Code plugin. Might be helpful. http://wordpress.org/support/topic/185935

I released the custom field template version 0.2. You can use TinyMCE in the textarea. Just add “tinyMCE = true” to the textarea section. Enjoy!

Awesome!!! Thank you! I’ll try it out.

Ohh…. now that’s just really nice. It works perfectly.

お世話になっております。

Custom Field Templateとても使いやすくて助かっています。

データベースの整理にカスタムフィールドはとても便利なのですが
カスタムフィールドの名前で投稿記事の並び替えが出来なくて困っています。

例えば、カスタムフィールドで映画を管理しているとして
映画のタイトルや星の評価などで記事を並び替えみたいなことです。


query_posts($query_string . "&posts_per_page=3&orderby=カスタムフィールドの名前&order=ASC")

上記のような感じで並び替えが出来ると、もっとカスタムフィールドの幅が
広がると思い実験してみているのですが、なかなかうまくいきません。

MySQLデータベースの posts と usermeta が別々になっているのが問題みたいで
http://wordpress.org/support/topic/169144
Forumsではデータベースの結合をして表示させているみたいのですが
ページ機能や1ページに何件表示するかコントロールしたいので

if (have_posts()) :
while (have_posts()) : the_post();

ループの中に入れて実現したいのですが、うまくいかず困っています。

Custom Field Templateの機能の追加ではないのですが
何かアドバイスをもらえたら幸いです。
よろしくお願いします。

ニコルさん、どうもこんにちは。

さて、カスタムフィールドでの投稿の並び替えですか。やってないから何とも言えませんが、フォーラムで語られてるSQLにLIMITを加えたら表示件数をコントロールできませんかね。

きちんと探してないのであれですが、Search Custom Fieldsというプラグインとかどうでしょうか。かなり古いプラグインではあるのですが、ソースとか見てみると何か参考になりませんでしょうか。

http://guff.szub.net/2006/04/21/search-custom-fields/

Custom Field Templateはカスタムフィールドの出力には関係ないのでどうしようもありません。

それでは頑張ってみてください。

返事が遅くなって申し訳ありません。

LIMITで表示件数はコントロール出来るのですが、
表示件数が20件あったとして、表示設定の1ページに表示する投稿数で10件表示させるようにしていると
2ページ目にも最初の10件が表示されてしまいます。
ページ機能を使用しなければ、全件表示することやLIMITで件数もコントロール出来るのですが
表示件数が多い場合もあるので、ページ機能を使用したいのです。

SQL文からforeachで記事を表示させているので、そうなると思うのですが

if (have_posts()) :
while (have_posts()) : the_post();

とフォーラムのSQL文を併用することは出来ないでしょうか?

Search Custom Fieldsは参考になりそうなのですが、
こちらの知識が乏しく、うまく理解出来ていません。

周りにPHPに詳しい人がいないので、どうかお力をお貸しください。
お手数ですが、よろしくお願いします。

ニコルさん、どうもこんにちは。

設定の表示投稿数と異なる件数を独自のqueryに適応させてページ機能を使用するというのはなかなかやっかいですね。一番いいのは設定の投稿数を表示したい件数にしてしまえばいいのですが、恐らく、カテゴリに応じて変更したいといったところでしょうか。

やるとすれば、特定のカテゴリに属する投稿のみに設定とは異なる表示件数を設定するようにフィルタをかます、というような感じになるんじゃないでしょうか。それをfunctions.phpなり、プラグインなりでやればいいような気がしますが実際にやってないのでわかりません。

have_posts()やthe_post()はWP_Queryクラスのメソッドなので、独自のqueryには使えないですね。フォーラムのSQL文をWP_Query内でできるようにフィルタなり、改造するなりすればできるかもしれませんが面倒そうです。

それでは頑張ってください。

お返事ありがとうございます。

>カテゴリに応じて変更したいといったところでしょうか。

そうなんです、カテゴリごとに表示件数をコントロールしていますので
設定の投稿数を同じ件数に出来ないんです。

色々、調べてみたり実験してみたのですが
知識不足、技術不足で行き詰っています。

不躾なお願いで、申し訳ないのですが、
お時間が空いている時で構いませんので
実験してくれませんでしょうか?
よろしくお願いします。

Hi, it’s a great plugin. It’s very very helpful to use for high dependable custom field themes.

However, is it possible to add Key = Image and Value = link to images?

If so, would you mind show me how to do it?

Sorry for the request. Thank you very much.

Hi Robin,

I am sorry for my late reply. I do not understand well what you would like to do. You mean that you put the image link into the custom field value and just display the image on the post? If so, it may be easy to do that. See the following documents.

http://justintadlock.com/archives/2007/10/27/wordpress-custom-fields-adding-images-to-posts
http://codex.wordpress.org/Using_Custom_Fields

I hope they would be helpful for you. Thanks.

はじめまして、maresといいます。

早速ですが、最新バージョン(0.3.1)を使ってみたのですが、
tinymceを有効にしたテンプレートからtinymceのないテンプレートに
切り替えると、WPのadmin-ajax.php(オートセーブ機能?)が動作するする時に、
tinymceが”e has no properties”とスクリプトエラーを発生させ、
それ以降、admin-ajax.phpが動作しないようです。
通常であれば、新規作成以外、途中でテンプレートを切り替えることは
あまりない思いますが、いちをご報告しておきます。
(もしかすると、このエラーは私の環境だけかもしれませんが・・・)

尚、条件は下記の通りです。
・wordpress 2.6.2
・プラグインは、Custom Field Template plugin 0.3.1のみ
・ブラウザは、Firefox 2.0系 + Firebug(IEは試してません)

少し調べてみたところ、テンプレートを切り替えるタイミングで、
tinymceを使っている場合には、tinymceのコマンド”mceRemoveControl”を
実行して、一端removeするとスクリプトエラーが回避できました。
(この方法がベストかわかりませんが、いまのところ動作しています。)

maresさん、こんにちは。

バグを教えていただきましてありがとうございます。不具合を修正したバージョンをリリースいたしました。

maresさんのご指摘いただいたテンプレートの切り替えで、admin-ajax.phpが動作しなくなるというのはとりあえず修正されていると思います。

しかしながら、本文の投稿欄の入力モードがHTMLで、カスタムフィールドにtinyMCEが使用されていた場合にも自動保存が利かなくなるようでして、こういう条件下では本文の投稿欄の入力モードをHTMLからtinyMCEに切り替えるように設定しました。どうも本文の投稿欄が最初にtinyMCEに設定してあれば、後でHTMLモードに変えてもエラーはでなくなります。なのでこういう条件下で、初期モードがHTMLの場合はHTML --> tinyMCE --> HTMLで元に戻してやればいいんじゃないかと思ったんですが、非同期がうまくできませんでした。

まだ修正できていないのは、本文の投稿欄もカスタムフィールドもHTMLモードで、カスタムフィールドを切り替えてtinyMCEのtextareaが出てきたとき、自動保存がうまく機能しなくなります。

ちょっとこの説明だと分かりにくかったかもしれませんが、カスタムフィールドでtinyMCEを使用したい場合は、本文の投稿欄もビジュアルに設定しておいてほしい、ということです。

とりあえず最新バージョンを使ってみてください。それではよろしくお願いします。

早々の対応ありがとうございます。

試してみましたが、問題なく動作しています。
私の使い方は、基本的に投稿欄はtinymceなので、投稿欄がHTMLの場合、
エラーが発生しているのは気付きませんでした。

また、不明な点がありましたらご連絡しますので、よろしくお願いします。

Is there a way to have the template create multiple fields with the same key? For example, if I want to add the names of multiple “co-authors” to a post about a book. I know I could do something like:

template name=”authors”

[author]
type = textfield
size = 50

[author]
type = textfield
size = 50

[author]
type = textfield
size = 50

Which would give me up to 3 “co-authors”, but is there a way to use the plugin if I don’t know how many co-authors there might be?

Hi Ben,

At present, this plugin does not support multiple fields with the same key which you do not know how many fields exist. I will consider about this in the next release. Thanks.

Hello,

I was fond of rc:custom_field_gui back in the days, so I am glad you update the idea.

But there’s an incompatibility between custom-field-template and Viper Video Quicktags: the video buttons disappear from the write post/page editor toolbar when custom-field-template is activated.

Hi Lionel,

I installed Viper Video Quicktags plugin and confirmed that the video buttons worked properly on the write editor with the custom field template plugin. Are you sure the custom field template is imcompatible with Viper Video Quicktags?

In the HTML editor (I don’t use the visual editor), Viper Video buttons disappear whenever CFT is activated, and come back upon CFT’s deactivation.
Maybe there’s more than one plugin at fault here — i.e. it’s the interaction of CFT with another plugin that cause the problem with Viper Video buttons — but deactivating CFT only solves the issue.

I confirmed your situation when the visual editor was unchecked in personal options. I fixed this bug and released the version 0.4.1. I hope this will work well. Thanks.

Same issue with just installed CFT version 0.4.

Configuration : WordPress 2.6.2 FR - CFT 0.4 - Viper Video Quicktags 6.1.2

OK, just saw your reply above. WIll try version 0.41 ASAP. Thanks !

Custom Field Template 0.4.1 vs. Viper Video Quicktags 6.1.2: this topic is resolved.

Thanks again!

hi. Thanks for plugin

perfect.

Regards

This plugin has a major bug. When activated, the “insert into post” does not work for the default Wordpress gallery. You might want to look into this ;)

I believe its a Javascript conflict

Hi Axertion,

You mean `Insert gallery into post`? I tested it and confirmed it is working. Well, [gallery] works only in the post field, not in custom fields. Could you tell me the detail of your situation? Are you using other plugins which seem to break it?

I have installed it and activated it but it will not display. What do I need to do to have it displayed? Thanks. Please email me

HI,
Thanks for a wonderful plugin. It makes using Custom fields so much easier. I need your help in configuring the following. I am giving the client a set of checkboxes whose items are links to product pages. When editing the page, the client just needs to check whether that product is applicable or not. The page will then show only those links that are checked. My question is how do I put the hyperlink in the checkbox items using the plugin?
Thanks
Ashish

Hi Ashish,

If you let your client choose one checkbox, use radio buttons. Something like this.

[link]
type = radio
value = http://wordpressgogo.com/news/ # http://wordpressgogo.com/plugins/ # http://wordpressgogo.com/themes/
default = http://wordpressgogo.com/news/

If multiple checkboxes, something like this.

[link]
type = checkbox
value = http://wordpressgogo.com/news/
checked = true

[link]
type = checkbox
value = http://wordpressgogo.com/plugins/
hideKey = true

[link]
type = checkbox
value = http://wordpressgogo.com/themes/
hideKey = true

Well, you may also use select boxes. Anyway, please try out various ways.

Hi,
Thanks for such a quick response. I have no problem placing the link text, but there is no hyperlink as in

Sorry - placing the HTML code for hyperlink seems to have eaten up the rest of my comment. What I meant was to place the actual HTML tag with hyperlink, next to the checkbox - not just the link text. I cannot do so currently through CFT, but can, by using the custom fields on the page editor itself, which is cumbersome.
Is there a way of achieving it with CFT and Checkboxes?
Thanks
Ashish

Hi Ashish,

I understand what you said. I released the version 0.4.3 which fixed this problem. I hope this will work well. Thanks.

Hiroaki San,
Thanks for taking the effort to include this feature. I will just test it an let you know the feedback.
Thanks
Ashish

Hiroaki San,
I tried using it and now it shows the hyperlinked option as I expect. Also the right url when I hover over it. But on publishing the page, the url shown for that link is actually the link address appended to current page address with backslashes. please take a look at http://sapling.in/apsl/solutions/technology-solutions/data-center-console-management/gui-console-management and hover over the BFSI link on right hand side to see what I mean
Thanks
ashish

Hi Ashish,
I tried it and confirmed it worked in my test site. Well, could you save your custom field option and try it again? After editing a post, could you confirm the default custom field sections (not custom field template sections) and whether the values include backslashes or not?

Hi,
I checked the values and they are as below:
I entered the following:
value = BFSI
It shows in the default custom fields sections as:
BFSI
(the \ is actually the backslash)
And on clicking BFSI on the actual page, it takes me to:
http://sapling.in/apsl/solutions/technology-solutions/data-center-console-management/%5C%22http://www.sapling.in%5C%22 (here, %5C%22 is the backslash)
Is there a mistake in the way I enter the values?
Thanks
Ashish

The href value in the default custom field section is \”http://www.sapling.in\”, which did not show properly in the last comment.

So the value in the default custom field section includes backslashes. Hmmm, it should not include them. Have you tried from the beginning of setting the custom field template options again? Every time backslashes are included in the values?

Hiroaki San,
I found the problem…When I use the “http://link.com” I get the backslashes. When I use http://link.com without the double-quotes, the link comes out all correct. Now only if you could include it in the documentation :) …
Thanks again for the wonderful plugin.
- Ashish

Hmmm, I understand what you say. But it should show correctly even if the link has double-quotes. Well, I will keep investigating this issue. Thanks.

Hello,

I’ve found that the Custom Field Template plugin seem to conflict with the WordPress uploader in the Write Post/Page panel.

See this post: http://wordpress.org/support/topic/197027?replies=29#post-887745

Hi Lionel,
I saw your post on the support forum. Well, could you try after activating only the custom field template plugin? If it works, some other plugins may conflict with the custom field template plugin. If it does not work, the custom field template plugin seems to be strange. However, in my wordpress the image uploader works with the custom field template plugin. Thanks.

if i use Custom Field Template and qTranslate ,the post content is blank after i saved the post.

Hi tankuan,
I installed qTranslate and noticed the post content were not saved properly when using tinyMCE in the custom field template. So tentatively do not use `tinyMCE = true` option in textareas. I will consider this issue in the future release.

Is there any way to get “Custom Field Template” section to appear above the “Post” section (the WYSIWYG editor) in the Write Post/Pages?

Translation:
「ポスト」セクション(WYSIWYGのエディター)の上で「習慣フィールド・テンプレート」に現われるセクションを持って来る全ての方法でそこにある 書くことポスト/ページで?

Hi Drath,
If you want to set custom field templates above the post section, you may need to edit WordPress core files. The positions of title and content are fixed. It seems to be difficult to change that without any hacks.

はじめまして、WP2.7b2-ja でテスト導入させていただきました。
非常に便利なプラグインだと思います。ありがとうございます。

早速ですが 2点の報告と1点の要望があります。
まず 1 点目の報告ですが、 textfield タイプの input 要素の type 属性値が v0.5.3 現在 textfield になっていますが、ここは text であるべきだと思いますので、どこかで修正をしていただけたらと思います。
次に 2 点目、load_plugin_textdomain() 関数の引数の関係で、私の環境では多言語化が出来ません。今のところ

load_plugin_textdomain(’custom-field-template’, ‘wp-content/plugins/custom-field-template’);

となっていますが、これが、

load_plugin_textdomain(’custom-field-template’, PLUGINDIR.’/’.dirname(plugin_basename(__FILE__)), dirname(plugin_basename(__FILE__)));

となっているとありがたいです。定数を使用しているのは、WP2.5 以降 (?)、 wp-content ディレクトリ以外にテーマやプラグイン、アタッチメントファイルを格納できるようになったためです。これについても可能ならば修正をお願いできますか?

最後に、これは勝手な要望ですが、 label を設定した際、label の表示位置は フォームアイテム要素の上ではなく、カスタムフィールドのキー名が現在表示されている箇所に、カスタムフィールドのキー名の代わりに表示されるようになって欲しい、またデータの記入例を挿入する項目が新たに欲しい (出来れば現在 label が表示されている位置などに)、と思います。
自分一人で WordPress を運用する場合には現状何も問題ないのですが、他の人と共同で運営する場合、その人にカスタムフィールドのキー名を意識させたくないことと、入力するデータのフォーマットをある程度規定したい用途 (たとえばイベントの日付を入力する場合など) を想定しています。

以上、前向きに検討していただければ幸いです。

Hello, i’m the one that was asking about changing the position.

I found the exact locations needed to place the code in edit-form-advanced.php to basically put content in between the title and post fields. I just need to know which code from custom-field-template.php to put in there. Could you help me with this at all? Thank you.

mizubeさん、お返事遅くなりました。

修正、ご要望に応じましたバージョン0.6をリリースしておりますので使用してみてください。

まず、type属性がtextfieldになっていた点はtextに修正しました。合わせてテンプレートの設定でも`type = text`が使えるようにしました。

load_plugin_textdomainにはwp-content ディレクトリ以外でも使用できるように定数利用に変更しました。うまく日本語化できるかご確認ください。こちらでは確認しておりませんので、よろしければうまくいったかどうかお知らせいただければ幸いです。

カスタムフィールドのキー名をラベルで置き換えるオプションを設定画面に追加しております。このオプションにチェックを入れると、ラベルがある場合のみ、カスタムフィールドのキー名の代わりにラベルを表示するようになります。試してみていただけたらと思います。

以上、うまくいくといいのですが、何かございましたらご連絡ください。

Hi Drath,

Try following codes into edit-form-advanced.php:

<php $custom_field_template->insert_custom_field(); ?>

You may need to comment out the lines 74-82 of the lateset version 0.6 of custom-field-template.php in order to avoid dupliacating the templates.

FYI, TinyMCE may not work properly.

I hope this will help you at all. Thanks.

This is almost there! Thanks for all the help. There seems to be a huge gap of whitespace above the custom fields for some reason. I have looked at the CSS that this plugin adds, but I can’t see anything that would do this. Any suggestions? Thanks again!

Hmmm, I do not know why whitespace is inserted. Is it because of the position where you put the code? Could you try to put it into other places and confirm whether the same situation happens or not? Thanks.

こんばんは。
早速の反映、ありがとうございます。

アップグレードしてみたところ、私の環境では無事 l10n されましたのでご報告いたします。ただし通常通り wp-content ディレクトリを使用している場合の動作についてはこちらでは確認しておりません。

ラベル入れ替えのオプションはカスタムフィールドのキーを表示させたい方もいるでしょうから、良いアイデアですね!

どうもご連絡いただきましたありがとうございます。
無事に翻訳できたようで何よりです。

また何かありましたらご連絡ください。

It doesn’t matter where I put it, it looks like it always tries to push it into the spot where it would sit normally in the write page. I’ve tried an echo statement and it produced no whitespace.

I tried uncommenting out the code in the plugin and it looks like when both are called, it’s placing the template stuff back in “Custom Field Template” tab. So it basically doubles itself, which proves my above statement - it tries to put it under the title/WYSIWYG box even though it isn’t (resulting in the whitespace).

I put the code I mentioned above into the line 211 of edit-form-advanced.php of WP2.6. Just above `<div id=”< ?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>” class=”postarea”>`. I think it looks good and could not confirm any whitespace. Hmmm, it is strange.

I’m trying to get WordPress to return a dropdown list (a SELECT MENU - similar to how we use “wp_dropdown_categories”) of VALUES for a particular custom KEY that I’ve entered in via the Custom Field Template.

I’d like to use this dropdown list as a way to filter the results shown on the page.

Can anyone point me to any examples or possibly something on the WP Codex?

The way that Custom Field Template plugin shows a dropdown list (Select Menu) is exactly what I need, except I need to show it on the site, not in the admin section.

thanks!

Comment