Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新たなmetaタグを追加できるようにする #2128

Closed
k-yamamura opened this issue Feb 20, 2017 · 3 comments
Closed

新たなmetaタグを追加できるようにする #2128

k-yamamura opened this issue Feb 20, 2017 · 3 comments
Assignees
Labels
enhancement 機能追加
Milestone

Comments

@k-yamamura
Copy link
Contributor

新規ページ作成時に定義可能なmetaタグとして、

  • author
  • description
  • keyword
  • robots

が定義可能だが、上記以外のmetaタグをページごとに追加する方法がないため、
default_frame.twigに新たに

<meta name="viewport" content="width=device-width, initial-scale=1">
{% block metas %}{% endblock %}
<link rel="icon" href="{{ app.config.front_urlpath }}/img/common/favicon.ico">

{% block metas %}{% endblock %} を追加し、個別のtwigファイルからmetaタグを追加できるようにするか、

または、ページ管理から上記で定義しているタグ以外の項目を追加できるように、
robots項目の後にフリーエリアのような項目を用意し新たなmetaタグを追加できるようにする。

2017-02-20 15 24 17

@Yangsin Yangsin added this to the 3.0.14 milestone Feb 21, 2017
@trebla-on
Copy link
Contributor

@t-nagahashi
実装の前に仕様を確認したいです。
以下の項目追加したいと思います大丈夫でしょうか
■DBカラム追加
テーブル: ---- dtb_page_layout
カラム: ----- meta_tags
タイプ: ----- longtext
NULL可能: - YES

■フォーム項目追加
項目名: フリーエリア
タイプ:  テキストエリア
バーリデト:50文字以内のみ(robots、keyword、descriptionと同じ)

@t-nagahashi
Copy link
Contributor

t-nagahashi commented Feb 24, 2017

@trebla-on
以下仕様で実装お願いできますでしょうか?

実現機能

1:twigにブロックを追加

{% block meta_tags %}{% endblock %} を追加し、個別のtwigファイルからmetaタグを追加可能にする
以下の準で記述下さい。
(別々に記述することにより、meta_tagsブロック使用時、上書きしてしまうことを防ぐ)

{% if PageLayout.meta_tags is not empty %}
    {{ PageLayout.meta_tags }}
{% endif %}

{% block meta_tags %}
{% endblock %}

2:ページ管理に、フリーエリアを追加

ページ管理から上記で定義しているタグ以外の項目を追加できるように、
robots項目の後にフリーエリア項目を用意し新たなmetaタグを追加可能にする

  • DBカラム追加
    テーブル: ---- dtb_page_layout
    カラム: ----- meta_tags
    タイプ: ----- longtext
    NULL可能: - YES

  • フォーム項目追加
    項目名: 追加metaタグ
    タイプ:  テキストエリア
    バーリデート:$config['lltext_len']を使用しチェック

placefolder:以下のように表示して下さい。
複数のmetaタグを入力可能

@ryo-endo
Copy link
Contributor

#2148で対応を取り込みましたので、こちらCLOSEさせていただきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 機能追加
Projects
None yet
Development

No branches or pull requests

5 participants