Forum

Thread tagged as: Question, Blog

php variable

hi, i am using the blog app

for my pages, the header is written in a separate php file and for the page title, i use this syntax:

<title><?=($pageTitle == "") ? "" : "$pageTitle"?></title>

in every page, i set some variables at the beginning, like this:

<?php
$pageTitle      = "";
$Description    = "";
include ("${Root}_header.php");
?>

my question is: how can i change the header for the blog pages

<title><?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?> - Blog Example</title>

i neet to transfer the postTitle in the variable for my pageTitle

can you help out ?

thank you! katja

Katja Schwarz

Katja Schwarz 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Like this:

$pageTitle      = perch_blog_post_field(perch_get('s'), 'postTitle', true);

this is the result in the html page

<title>perch_blog_post_field(perch_get('s'), 'postTitle', true)</title>

sorry, it works without quotes ""

thanks a lot ! best regards, katja