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

【API】アイキャッチを取得時の画像のURLをそのまま読み込めるURLにしたい #2928

Open
kaburk opened this issue Dec 7, 2023 · 3 comments
Labels
Reviewed レビュー済 Todo 実行確定タスク

Comments

@kaburk
Copy link
Collaborator

kaburk commented Dec 7, 2023

概要

baser APIでブログ記事のアイキャッチなどの画像を取得する際に現在はDBの値をそのまま出力していると思います。

フロントエンドのJSなんかで取得した時に画像を表示しようとするとそのままのURLでは画像が表示されず、都度コンテンツ毎に仕様を把握して画像URLを組み立てる必要があります。

仕様理解できている前提なら良いのですが、これは流石に使いづらいので画像のURLを組み立てた後の値を取得できるような仕組みが欲しいです。というかそれがデフォルトになって欲しいです。

例えば、下の例だと
スクリーンショット 2023-12-07 20 48 33

"eye_catch": "2016/08/00000002_eye_catch.jpg",

"eye_catch": "/files/blog/1/blog_posts/2016/08/00000002_eye_catch.jpg",

というような感じでそのまま表示できる画像URLが取得できると便利かと思います。

baserCMS version : 5.0.7

@kaburk kaburk changed the title API APIでアイキャッチを取得時の画像のURLをそのまま読み込めるURLにしたい Dec 7, 2023
@ryuring
Copy link
Collaborator

ryuring commented Dec 7, 2023

@kaburk 確かこちらはこのプルリクで実装済だったはずなんですができてないですかね?
#2771

@ryuring ryuring added the Reviewed レビュー済 label Dec 7, 2023
@kaburk
Copy link
Collaborator Author

kaburk commented Dec 11, 2023

@ryuring 再度確認しました。確かにブログ記事は対応されているようですが、それ以外は対応されていない感じでした。
(ブログ、固定ページなどコンテンツ管理テーブルなどのアイキャッチやカスタムコンテンツの画像フィールドなど)

スクリーンショット 2023-12-11 15 58 49
スクリーンショット 2023-12-11 16 10 21
スクリーンショット 2023-12-11 16 00 13

スクリーンショット 2023-12-11 16 00 36

@kaburk kaburk removed their assignment Dec 11, 2023
@ryuring ryuring added the Todo 実行確定タスク label Dec 11, 2023
@ryuring
Copy link
Collaborator

ryuring commented Dec 11, 2023

@kaburk ブログ記事が実装できているということでよかったです。
同じ手法で他のエンティティも随時実装していく必要がありますね。

@ryuring ryuring changed the title APIでアイキャッチを取得時の画像のURLをそのまま読み込めるURLにしたい 【API】アイキャッチを取得時の画像のURLをそのまま読み込めるURLにしたい Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed レビュー済 Todo 実行確定タスク
Projects
None yet
Development

No branches or pull requests

2 participants