[WordPress] 外掛分享: Dragons Print-Hint

首頁外掛目錄 › Dragons Print-Hint
10+
安裝啟用
尚無評分
6053 天前
最後更新
問題解決
WordPress 2.7.1+ v0.4.1.1 上架:2009-06-27

內容簡介

在文章中印出提示文字有幾個原因。這些提示文字不會在螢幕上顯示,但你希望它會出現在列印紙張上。

功能清單:

定義提示文字,僅出現在列印紙張上。
你可以使用任何可以放置在<p>...</p>中的HTML標籤來格式化你的提示文字。
透過管理設置面板來舒適地定義提示文字。
隱藏文章/頁面中使用者定義區域-在任意部分之三中查看範例
ShortTag[PrintHint] 可以自由定義只在螢幕上/出力中顯示的文章區塊
在逗號分隔的列表中定義CSS類別(.classname)。這些類別不會出現在列印紙張上。
在逗號分隔的列表中定義CSS ID(#idname)。這些ID不會出現在列印紙張上。
設定列印框架的樣式定義
多語言支援:已實作英文、德語、俄語

這個外掛使用 the_content 過濾器搭配。使用 the_excerpt 過濾器勾選用於從搜尋結果頁面中移除提示。

*情境*

你只想在線上顯示一段文字?

[PrintHint show_on=”screen”] … 只在螢幕上顯示 … [/PrintHint]

你只想在列印紙張上顯示一段文字?

[PrintHint show_on=”print”] … 只在列印紙張上顯示 … [/PrintHint]

*提示*

注意關閉標記[/PrintHint]以及參數show_on,它們是必須的!
如果你不應用參數或給予錯誤的引數,內容區塊都將無法顯示。

在設定頁面中刪除整個框架CSS樣式將啟用定義在fdrag_phi_print.css中的預設樣式。

任意部分
範例1:提示文字
<center><b>注意</b> - 版權聲明! <br>
This Blog is licensed under a Creative Commons License,
which permits you to easily print the articles for personal use.
However, if you are viewing a site that does not contain such a license information and policies,
then printing a copy for personal use may not be permissible and lead to copyright/DMCA issues.</center>

範例2:CSS類別/ID隱藏
#header, #top, #footer, #bottom, #sidebar,
.commentheader, #commentform

範例3:當印出時,隱藏文章/頁面中的一些部分

在文章中定義一個使用者定義且未被使用的ID區域。
這個ID不需要在所有CSS樣式表中都定義。它只適用於龍之列印提示。

.. 文章的一些內容
<div id="RemoveOnPrint"> … 這裡是文章的一些內容 … </div>
… 更多文章內容

如果你將這個ID(#RemoveOnPrint)定義在“隱藏CSS區塊”列表中(記住:逗號分隔多個值)
你可以看到帶有所有內容的文章,但在列印時使用具有id="RemoveOnPrint" 屬性的div標籤時會被隱藏。

範例4:使用短碼

如果文章中有需要在螢幕/列印輸出中明確隱藏/顯示的區域,
你可以使用短碼

[PrintHint show_on="screen|print"] .... [/PrintHint].

僅在線上顯示圖形連結,在列印紙張上則顯示URL。

我的文章內容
[PrintHint show_on="screen"]<a href="some url"><img src="myImage" /></a>[/PrintHint]
[PrintHint show_on="print"]http://myUrl[/PrintHint]<br>
文章其他內容

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.4.1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Dragons Print-Hint」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

There are several reasons to print some hints on your posts. These hints will never been seen on the screen, but you want it to show on paper.
Feature-List:

Definition of a hint text, only appearing on printouts.
You can use any html tag that can be placed within

...

to format your hints.
Comfortable definition of hint text via admin settings panel.
Hiding user defined areas of posts / pages – see Example 3 in Arbitrary section
ShortTag [PrintHint] for free definition of post-blocks show only on screen/print output
Definition of CSS classes (.classname) in a comma separated list. These classes don’t appear on printouts.
Definition of CSS IDs (#idname) in a comma separated list. These IDs don’t appear on printouts.
Style definition for printout border frame
Multilanguage Support: English, Deutsch, Russian already implemented

The plugin hooks into the_content filter. The the_excerpt filter hook is used to remove the hint from displaying on search result page.
*Scenarios*
You want to show a text only online?

[PrintHint show_on=”screen”] … appears only on screen … [/PrintHint]

You want to show a text only on printout?

[PrintHint show_on=”print”] … appears only on printouts … [/PrintHint]

*Hint*
Beware of the closing tag [/PrintHint] as well as the parameter show_on, they are REQUIRED!
If you don’t apply the parameter or give them a wrong argument, the block content will not be displayed, anyway.
Removing the whole border css style from config page will activate the default style defined in fdrag_phi_print.css
Arbitrary section
Example 1: Hint-Text

Achtung - Urheberrechtshinweis!
Da dieses Blog unter einer Creative Commons Lizenz steht,
stellt das Ausdrucken für Sie kein Problem dar.
Bei Webseiten die nicht unter einer solchen oder ähnlichen Lizenz stehen,
kann das Ausdrucken zu einer Urheberrechtsverletzung führen.

Example 2: CSS Class/ID hiding
#header, #top, #footer, #bottom, #sidebar,
.commentheader, #commentform

Example 3: Hide some portion of a post / page while printing
Within the post define an area with a userdefined and no more referenced ID.
This ID don’t have to be defined within any CSS stylesheet. It’s just for Dragons Print-Hint.
.. some content of your post

... here is some content of the post ...

.. some more content of your post

If you define this ID (#RemoveOnPrint) in the “hide css blocks” list (remember: comma separate more then one value)
you can see the post with all content but while printing the div tag with id=”RemoveOnPrint” ist hidden.
Example 4: Using shortcodes
If there are areas within your post to explicitly hide/show on screen/print output,
you can use the shortcode

[PrintHint show_on="screen|print"] .... [/PrintHint].

Show graphical link only online, on printouts show the URL instead.

Here is my post text
[PrintHint show_on="screen"][/PrintHint]
[PrintHint show_on="print"]http://myUrl[/PrintHint]
and here is the rest of the text.

The Parameter show_on can be used to define the apperance of the content between the shortcode tags.
If you define show_on=”screen” the content part will only be shown an screen outputs.
Otherwise, the show_on=”print” parameter will show the hint only on printouts.

Remark: If you dont’t use the ‘show_on’ parameter or forget to close the shortcode tag, there will be no output!

= Example 5: Using your own border style for print-hint
Just enter the border attributes (see http://www.w3schools.com/css/pr_border.asp for usage example)
without the semicolon. e.g. 5px solid red

延伸相關外掛

文章
Filter
Apply Filters
Mastodon