Skip to content

Instantly share code, notes, and snippets.

@ElliottLandsborough
Last active October 10, 2019 16:02
Show Gist options
  • Save ElliottLandsborough/acb1b5ae035cbb5e0868a9fc742ff17b to your computer and use it in GitHub Desktop.
Save ElliottLandsborough/acb1b5ae035cbb5e0868a9fc742ff17b to your computer and use it in GitHub Desktop.
Some random examples
<section class="grid" id="eventGrid">
<div class="gridSizer"></div>
@foreach (getAllEvents(true) as $event)
<div class="event {!! ($loop->iteration > 1) ? 'extraMargin' : '' !!}">
<p style="background-color:#fff;color:#000;">--- example of including the post var from the context of events.blade.php</p>
@include('partials.blocks.sidekick', ['lolVariable' => $event])
<div class="featureImage" style="background-image: url('{!! get_field('image', $event)['sizes']['article'] !!}');"></div>
<div class="textContainer">
<h2>{!! get_the_title($event) !!}</h2>
{!! get_field('text', $event) !!}
<ul class="details">
<li><i class="far fa-calendar-alt"></i>{!! $event->start_date !!}</li>
<li><i class="far fa-clock"></i>{!! $event->start_time !!} - {!! $event->finish_time !!}</li>
</ul>
@if (get_field('event_status', $event) !== 'sold-out')
<a class="CTA" href='mailto:{!! get_field('email', $event) !!}'>I'm Attending</a>
@else
<a class="CTA_disable">Sold Out</a>
@endif
</ul>
</div>
</div>
@endforeach
</section>
<?php
var_dump($lolVariable);
?>
<section class="headline" style="margin: -15vw 0 0 0;">
<img src="{!! get_field('sidekick_foreground')['url'] !!}" alt="Whollar" />
<div class="textBox">
<h2>{!! get_field('sidekick_title', get_page_by_path('events') ) !!}</h2>
{!! get_field('sidekick_text', get_page_by_path('events') ) !!}
</div>
</section>
<!--Second param points to events page id which houses the title/text,
without this it looked at the layout for Event items instead as they were called last-->
{{--
Template Name: Events
--}}
@extends('layouts.app')
@section('content')
<!-- front page content -->
@while(have_posts()) @php the_post() @endphp
{{--@include('partials.page-header')--}}
@if (((isset($_GET['preview']) && $_GET['preview'] !== 'true')) || !isset($_GET['preview']))
@include('partials.blocks.hero')
@else
{{-- hacks only for admin panel preview --}}
<br /><br /><br /><br /><br />
@endif
@include('partials.blocks.events')
<p style="background-color:#fff;color:#000;">--- example of including the post var from the context of template-events.blade.php</p>
@include('partials.blocks.sidekick', ['lolVariable' => $post])
@endwhile
<!-- /front page content -->
@endsection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment