Skip to content

Before and After functions #3

@dwest

Description

@dwest

Sometimes you want to append or prepend something to the parent's content instead of replacing it outright. This is not currently possible with append/prepend because they work only in the parent template. To that end we should add before and after functions that work outside of the normal blocks and are only concatenated after the block is full processed.

For example:

===File A===

Default

===File B===

<?php $after('content')?>
<div>After</div>
<?php $end('content')?>

===File C===

<?php $before('content')?>
<div>Before</div>
 <?php $end('content")?>

<?php $block('content')?>
<div>Override</div>
<?php $end('content')?>

Would produce:

Before

Override

After

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions