external covers

This commit is contained in:
Jeremy Kauffman 2020-01-31 12:38:28 -05:00
parent 6667b3c8ae
commit c68a373d62

View file

@ -3,9 +3,13 @@
<?php NavActions::setNavUri('/news') ?> <?php NavActions::setNavUri('/news') ?>
<main class="news ancillary"> <main class="news ancillary">
<section <?php $bgStyle = '' ?>
class="hero hero--news<?php echo $post->getCover() ? '' : ' hero--half-height'?>"<?php echo $post->getCover() ? ' style="background-image: url(\'/img/blog-covers/' . $post->getCover() . '\')"' : ''?> <?php if ($post->getCover()): ?>
> <?php $bgStyle = preg_match('/https?:\//', $post->getCover()) ?
' style="background-image: url(\'' . $post->getCover() . '\')"' :
' style="background-image: url(\'/img/blog-covers/' . $post->getCover() . '\')"' ?>
<?php endif ?>
<section class="hero hero--news<?php echo $post->getCover() ? '' : ' hero--half-height'?>" <?php echo $bgStyle ?>>
<div class="inner-wrap inner-wrap--center-hero"> <div class="inner-wrap inner-wrap--center-hero">
<h1><?php echo nl2br(htmlentities($post->getTitle())) ?></h1> <h1><?php echo nl2br(htmlentities($post->getTitle())) ?></h1>
<h2> <h2>