Site Builder
Editing:
product.php
writable 0666
<?php // expects $CATEGORY and $ASIN set by stub, _core.php loaded $item = load_product($CATEGORY, $ASIN); ?><!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1"/> <title><?php echo e($item['title'] ?? $ASIN); ?></title> <style> :root { --bg:#fafafa; --card:#fff; --line:#dcdcdc; --text:#111; --muted:#555; --accent:#111; } body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;font-size:18px;line-height:1.6;margin:0;background:var(--bg);color:var(--text)} .wrap{max-width:1040px;margin:0 auto;padding:24px} .crumb{font-size:16px;color:var(--muted);margin-bottom:12px} .card{background:var(--card);border:2px solid var(--line);border-radius:14px;padding:20px;display:flex;gap:20px;box-shadow:0 1px 3px rgba(0,0,0,.05)} .img{width:380px;min-height:240px;background:#f4f4f4;border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden} .gallery{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap} .thumb{width:80px;height:80px;object-fit:cover;border:2px solid var(--line);border-radius:10px} .badge{display:inline-block;padding:6px 10px;border:2px solid var(--line);border-radius:999px;font-size:14px;margin:0 6px 6px 0} .btn{display:inline-block;padding:12px 16px;border:3px solid var(--accent);border-radius:10px;text-decoration:none;color:var(--accent);font-weight:700} .btn:hover{background:var(--accent);color:#fff} .muted{color:var(--muted);font-size:16px} h1{margin:.2em 0 .2em;font-size:28px} h2{font-size:20px;margin:1em 0 .3em} @media (max-width:900px){ .card{flex-direction:column} .img{width:100%} } </style> </head> <body><div class="wrap"> <div class="crumb"><a href="<?php echo '../'; ?>">← Back to <?php echo e($CATEGORY); ?></a></div> <div class="card"> <div> <div class="img" aria-label="Product image"> <?php if ($item && !empty($item['_image_srcs'])): ?> <img src="<?php echo e($item['_image_srcs'][0]); ?>" alt="<?php echo e($item['title'] ?? $ASIN); ?>" style="width:100%;height:auto"/> <?php else: ?> <span>Upload an image to this ASIN folder</span> <?php endif; ?> </div> <?php if ($item && count($item['_image_srcs'])>1): ?> <div class="gallery" aria-label="More images"> <?php foreach (array_slice($item['_image_srcs'],1) as $g): ?> <img class="thumb" src="<?php echo e($g); ?>" alt=""> <?php endforeach; ?> </div> <?php endif; ?> </div> <div> <h1><?php echo e($item['title'] ?? $ASIN); ?></h1> <?php if (!empty($item['subtitle'])): ?><p class="muted"><?php echo e($item['subtitle']); ?></p><?php endif; ?> <?php if (!empty($item['badges'])): ?> <p><?php foreach ($item['badges'] as $b) echo '<span class="badge">'.e($b).'</span>'; ?></p> <?php endif; ?> <?php if (!empty($item['summary'])): ?><p><?php echo e($item['summary']); ?></p><?php endif; ?> <?php if (!empty($item['bullets'])): ?> <h2>Key details</h2> <?php echo render_list($item['bullets']); ?> <?php endif; ?> <?php if (!empty($item['pros']) || !empty($item['cons'])): ?> <div style="display:flex;gap:24px;flex-wrap:wrap"> <?php if (!empty($item['pros'])): ?> <div style="min-width:240px"><h2>Pros</h2><?php echo render_list($item['pros']); ?></div> <?php endif; ?> <?php if (!empty($item['cons'])): ?> <div style="min-width:240px"><h2>Cons</h2><?php echo render_list($item['cons']); ?></div> <?php endif; ?> </div> <?php endif; ?> <p style="margin-top:16px"> <a class="btn" href="<?php echo e($item['affiliate_url'] ?? '#'); ?>" target="_blank" rel="nofollow sponsored">See price on Amazon</a> </p> <p class="muted" style="margin-top:8px;">As an Amazon Associate I earn from qualifying purchases.</p> </div> </div> </div></body> </html>
Save changes
Create folder
writable 0777
Create
Cancel