category

Craft CMS の Redactor で挿入したサムネイル画像に元画像のリンクを入れられたらいいなーと思った #craftcms

2019-09-10

記事に画像を埋め込んでいて、例えば

こんな感じで埋め込んだときに。

<figure><img src="https://note.mersy418.com/asset/_trim_auto_180/KM19730026_TP_V4.jpg#asset:24847:transform:trim_auto_180" data-image="24847"></figure>

元サイズの画像にもリンクを張りたいと思うことがあるよなー、と。

MTだとファイルにリンクを入れるとかオプションあったし、WPにもリンク設定出来るし。

ということで調べてたら、とりあえず Redactor で Filemanager でリンクさせときゃいいよ、というかんじであったので、 Filemanager の設定を入れてみる。

redactor - How can I link to an Asset from the Rich Text editor? - Craft CMS Stack Exchange
https://craftcms.stackexchange...

config/Standard.json とかに

{
  "buttons": ["html","formatting","inlinestyle", "bold", "italic", "unorderedlist", "orderedlist", "line","link", "image", "video","table","clips","widget"],
↓↓↓
{
  "buttons": ["html","formatting","inlinestyle", "bold", "italic", "unorderedlist", "orderedlist", "line","link", "image", "video","table","clips","file","widget"],

こんな感じでファイルをいれることで、ファイルアイコンが表示される。

こうすることで

リンクもサクッと入れられる。。。。?残念、入れられない。

テキストならどうか?

入れられた。なるほど、テキストだけか。

埋め込んだ画像の編集を押せば、リンクの欄は出てくるんだけど、ここでサクッと元画像のリンクとかがわかるといいんだけどな。。。