<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>動的モーダル on qwerty.work</title>
        <link>https://qwerty.work/tags/%E5%8B%95%E7%9A%84%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB/</link>
        <description>Recent content in 動的モーダル on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Tue, 16 Jan 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://qwerty.work/tags/%E5%8B%95%E7%9A%84%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【STUDIO】CMSの詳細ページをモーダルで表示したいとき</title>
            <link>https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/</link>
            <pubDate>Tue, 16 Jan 2024 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/</guid>
            <description>&lt;p&gt;シングルページタイプのコーポレートサイトを&lt;a class=&#34;link&#34; href=&#34;https://studio.design/ja&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;STUDIO&lt;/a&gt;で制作し、簡単なお知らせ（ニュース）を組み込むことになりました。お知らせの詳細ページは簡易的なものにしたかったので、詳細ページを作らず、何の飾りもないモーダルで作ることにしました。&lt;/p&gt;&#xA;&lt;p&gt;以前では、&lt;a class=&#34;link&#34; href=&#34;https://studio.design/ja&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;STUDIO&lt;/a&gt;のCMS機能で生成される動的な内容をモーダルで表示できなかったみたいですが、この記事を投稿した今日現在はアップデートされて機能が追加されていました。その方法をメモ。&lt;/p&gt;&#xA;&lt;h2 id=&#34;動的モーダルを作成する方法&#34;&gt;動的モーダルを作成する方法&#xA;&lt;/h2&gt;&lt;p&gt;前提として、あらかじめCMSのデータが作成されていることを前提としています。ここでは**「news」**というCMSモデルを作成した例にしています。&lt;/p&gt;&#xA;&lt;h3 id=&#34;ページを追加&#34;&gt;ページを追加&#xA;&lt;/h3&gt;&lt;p&gt;**「ページ」&lt;strong&gt;タブで&lt;/strong&gt;「+」**ボタンを押す&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;290px&#34; data-flex-grow=&#34;121&#34; height=&#34;366&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-00-1.jpg&#34; width=&#34;443&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;隠れたメニューを表示する&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;737px&#34; data-flex-grow=&#34;307&#34; height=&#34;206&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-01-1.jpg&#34; width=&#34;633&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;**「動的モーダル」**を選択する&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;1517px&#34; data-flex-grow=&#34;632&#34; height=&#34;162&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-02-1024x162.jpg&#34; srcset=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-02-1024x162_hu_f19f52c2d6f97f10.jpg 800w, https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-02-1024x162.jpg 1024w&#34; width=&#34;1024&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;対象のCMS（データベース）を選択&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;335px&#34; data-flex-grow=&#34;139&#34; height=&#34;283&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-03-1.jpg&#34; width=&#34;396&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;モーダルページが追加されるので、ランダムなパスを「news」など、わかりやすい階層名に変更します。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;335px&#34; data-flex-grow=&#34;139&#34; height=&#34;283&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-03.jpg&#34; width=&#34;396&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;テキストを配置&#34;&gt;テキストを配置&#xA;&lt;/h3&gt;&lt;p&gt;モーダルページにテキストを配置してデータを紐づける&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;274px&#34; data-flex-grow=&#34;114&#34; height=&#34;679&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-05.jpg&#34; width=&#34;776&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;モーダルを開くリンクを設置&#34;&gt;モーダルを開くリンクを設置&#xA;&lt;/h3&gt;&lt;p&gt;**「お知らせ」**欄のタイトルにモーダルのリンクを設置&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;524px&#34; data-flex-grow=&#34;218&#34; height=&#34;398&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-06.jpg&#34; srcset=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-06_hu_555e427d6a7176a0.jpg 800w, https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-06.jpg 870w&#34; width=&#34;870&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;完成&#34;&gt;完成&#xA;&lt;/h3&gt;&lt;p&gt;これでCMSに投稿した内容がモーダルに表示されます。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;403px&#34; data-flex-grow=&#34;168&#34; height=&#34;326&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2024/01/studiocms%E3%81%AE%E8%A9%B3%E7%B4%B0%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E3%83%A2%E3%83%BC%E3%83%80%E3%83%AB%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E3%81%8D/images/No-07.jpg&#34; width=&#34;548&#34;&gt;&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
