On Feb 17, 2008 12:56 AM, xanders <[EMAIL PROTECTED]> wrote:

> this is probably something pretty common for all of us. I would like
> the site title to be appended / perpended (not sure what one yet) to
> each page title.

For Symfonians, I've put the thing in the layout and handle the page
title using a dedicated slot:

# layout.php
<?php if (has_slot('page_title')): ?>
  <title><?php include_slot('page_title') ?> - <?php echo
sfConfig::get('app_global_sitename') ?></title>
<?php else: ?>
  <?php include_title() ?>
<?php endif; ?>

# modules/people/templates/homeSuccess.php
<?php slot('page_title') ?>
  <?php $page_title = __('Symfony developers') ?>
  <?php echo $page_title ?>
<?php end_slot() ?>
<h2><?php echo $page_title ?></h2>

Maybe there's a better way, but using a filter for this purpose would
be a bit overkill to me and I like to keep page titles handling in the
view part. Matter of taste.

++

-- 
Nicolas Perriault    http://www.clever-age.com
Clever Age - conseil en architecture technique
GSM: +33 6 60 92 08 67  Tél: +33 1 53 34 66 10

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to