Site Builder
Editing:
modules-cta1.php
writable 0666
<?php /************************************************************************** * CTA MODULE – Call to Action cards (gold outline) * ---------------------------------------------------------------------- * • Reads ../../cta.json (array of {title,html,button{label,url}}) * • Shows one card per entry **************************************************************************/ /* 1) Load CTA JSON */ $ctas = get_cta(); if (!$ctas) return; ?> <section class="cta-shell"> <?php foreach ($ctas as $i => $c): $title = $c['title'] ?? ''; $html = $c['html'] ?? ''; $btn = $c['button'] ?? []; if (!$title && !$html) continue; ?> <a name="cta"></a> <div class="cta-card"> <?php if ($title): ?><h2><?= $title ?></h2><?php endif; ?> <?php if ($html): ?> <div class="cta-body"><?= $html /* already HTML-escaped in JSON */ ?></div> <?php endif; ?> <?php if (!empty($btn['label']) && !empty($btn['url'])): ?> <p class="cta-action"> <a class="cta-btn" href="<?= htmlspecialchars($btn['url']) ?>" target="_blank" rel="noopener"> <?= htmlspecialchars($btn['label']) ?> </a> </p> <?php endif; ?> </div> <?php endforeach; ?> </section> <style> /* ----- wrapper keeps width consistent with other gold cards ----- */ .cta-shell { margin: 2.6rem auto; max-width: clamp(480px, 70vw, 720px); width: 100%; font-family: system-ui, Arial, sans-serif; padding: 0 1rem; } /* ----- card ----- */ .cta-card { background: #fff; padding: 1.8rem 1.6rem; border: 3.5px solid #ffb63b; border-radius: 27px; box-shadow: 0 8px 26px rgba(0, 0, 0, .06); margin-bottom: 2.2rem; text-align: center; transition: transform .2s, box-shadow .2s; } .cta-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, .08); } .cta-card h2 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 700; color: #102a66; text-align: center; } /* ----- body content left-aligned ----- */ .cta-body { font-size: 1.05rem; color: #333; line-height: 1.6; margin-bottom: 1.5rem; text-align: left; } /* paragraphs inside body */ .cta-body p { margin: 0.6rem 0; } /* lists inside body */ .cta-body ul, .cta-body ol { margin: 0 0 1.5rem 1.3rem; padding: 0; list-style-position: outside; text-align: left; } /* ----- button ----- */ .cta-action { margin-top: 0.5rem; text-align: center; } .cta-btn { display: inline-block; background: #2357d7; color: #fff; padding: .75em 2em; border-radius: 8px; font-weight: 700; font-size: 1.05rem; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); transition: background .15s, transform .15s; } .cta-btn:hover { background: #1e4dbf; transform: translateY(-2px); } </style>
Save changes
Create folder
writable 0777
Create
Cancel