Forum
get eventTitle
Having trouble fetching the eventTitle for my Meta tag and cannot work out what I have missed!
<?php include('../perch/runtime.php');
$title = perch_events_event_field(perch_get('event'),'eventTitle',true);
?>
<!DOCTYPE html>
<head>
<title><?php echo $title; ?> Webinar Registration </title>
template
<div class="vevent">
<h2 class="summary"><perch:events id="eventTitle" /></h2>
<p class="dtstart"><span class="value-title" title="<perch:events id="eventDateTime" format="c" />"><perch:events id="eventDateTime" format="%c" /></span></p>
<div class="description"><perch:events id="eventDescHTML" type="textarea" textile="true" editor="markitup" encode="false" /></div>
<p class="category"><perch:events id="category_names" encode="false" /></p>
<perch:if exists="image">
<img src="<perch:events id="image" type="image" label="Image" width="640" crop="true" />" alt="<perch:events id="eventTitle" />" />
</perch:if>
</div>
Debug Message - Perch 3.0.9
[1] SELECT * FROM perch2_events WHERE eventSlug = ''
[1] SELECT * FROM perch2_pages WHERE pagePath='/events/event.php' LIMIT 1
Using template: /templates/pages/attributes/seo.html
Using template: /templates/search/search-form.html
[12] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/events/event.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT DISTINCT e.* FROM perch2_events e WHERE eventID='1'
[24] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] Using template: /templates/events/listing/event-detail.html
[1] SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='1'
Do you have
?event=something
in your URL?/events/event.php?id=1
Ok, so
perch_get('event')
isn't going to return anything, is it? There's no item calledevent
in the URL.If
id
is the event ID, use that instead.perch_get('id')
perfect, thank you!