concrete5.7.x Page Template sample which just to redirect for rich attributes in Page List or Autonav blocks / ページリストで追加の属性情報を表示させる時とかに使える、シンプルにリダイレクトをするためのページテンプレート
Sometime, "external link" doesn't fulfill your requirement for the page. You may want to display thumbnail image, additional page attribute such as topic and selector attributes to display the categories of the page.
This tutorial explains how to set-up redirect-only page with more page attributes option by creating redirect-only page template and page type in your theme.
(You may also want to customize your Page List and/or Autonav Blocks if you want to avoid additional redirect requests)
I hold no responsibility over any damages caused by using this script.
This uses Page Selector Attribute
https://www.concrete5.org/marketplace/addons/page-selector-attribute1/
Currently, if you are the site editor who can see the concrete5 toolbar on top, you won't get redirected but stayed on the page so that you'll be able to edit.
- Copy and paste redirect.php below and create a page template under your theme.
- Create a page type. Add composer elements to enter page name, url and the following page attributes.
Create a page selector attribute called "external_page"
Or comment out or delete from line 6-10.
Create a text page attribute called external_link, which you enter URL.
If both externap_page and external_link was entered, externap_page will be used.
You could add File Attribute to have them download the file.
concrete5 Japan, Inc. is helping various company's concrete5 project. Please feel free to contact us at any time for your project needs. We can work internationally.
concrete5 のデフォルトの外部リンクは、ページリストやオートナビブロックで属性情報を追加できません。なので、リダイレクト専用のページテンプレートを作成するといいかもです。
(このカスタマイズは余分なリダイレクトリクエストを増やすので、それを好まない方は Page List や オートナビブロックより直接外部リンクに飛ぶように設定されるのも推奨します。)
このコードは無保証です。
「Page Selector Attribute」という無料アドオンを使用します。 https://www.concrete5.org/marketplace/addons/page-selector-attribute1/
redirect.php
ファイルを自分のテーマファイルにコピーし redirect というハンドルでページテンプレートを作成してください。。- ページタイプを作成し、コンポーザーで、ページ名、URLや属性を追加できるように設定しておきましょう。
このページテンプレートで作成するページは、フルサイトマップでのみ使える想定です。
アドオンをインストールして作った、「external_page」属性を作成してください。
必要に応じて、Line 6-10 を削除したりコメントアウトしてください。
「external_link」というテキスト (1行) のページ属性を入れてください。
現在のコードでは、「external_page」 と「external_link」両方に入力されている場合、「external_page」が優先されて表示するようになっています。
ファイル属性を課金コードに追加すると、ニュースリリースで PDF だけをダウンロードさせたい時とかに使えます。試してみてください。
コンクリートファイブジャパン株式会社では、企業・団体様の concrete5 サイト制作や制作会社様のプロジェクトのサポートを行っています。また制作会社様向けに「インテグレートパートナー制度」を設け、印刷物では通常は使用禁止している concrete5 のロゴが使えるパートナー制度の運営も行っています。