Add custom attribute block to a template
For the sake of the question I suppose you could do something like this which would display the page title...
<?php $attr = BlockType::getByHandle('page_attribute_display'); $attr->controller->attributeHandle = 'rpv_pageName'; $attr->render(); ?>
But it's a hell of a lot easier to just do
<?php echo $c->getCollectionName(); ?>
I'm guessing you've got a custom attribute or something going on? Can you not just grab it with the handle like so?
$myThing = $c->getAttribute('my_thing');
just thought I'd chime in here. This isn't really what you asked but might achieve a similar result without resorting to hardcoding and losing some flexibility In your page templates.
With page types and page templates now being decoupled you can create page types and add default blocks / attributes etc into them directly via the GUI without having to hardcode values and possibly limit the utility/flexibility of your page templates.
Just a thought. Please ignore as appropriate...