Skip to content

Markup Regions: nested/recursive manipulations not working #195

@Toutouwai

Description

@Toutouwai

Short description of the issue

Nested/recursive manipulation of elements is not working as per the blog post introduction.

Expected behavior

From the blog post:

By that token, the elements that you manipulate don't even have to be part of the main document markup. This template strategy can be nested and go recursive. Meaning you can manipulate something you added from a template file or some other include(), which could be useful in certain cases where you might want it.

And a comment by @ryancramerdesign:

By nesting, I mean that you can do this (pretend this is HTML)

[div id=photo class=pw-append-sidebar]
[img src='...']
[/div]

[caption class='pw-append-photo']
Caption added to photo div
[/caption]

Steps to reproduce the issue

In _main.php...

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title><?= $page->title ?></title>
</head>
<body>

<div id="main">
	<p>Default main content.</p>
</div>

</body>
</html>

In home.php...

<div id="box" pw-append="main">
	<p>Paragraph 1</p>
</div>

<p pw-append="box">Paragraph 2</p>

The #box div and Paragraph 1 are appended to #main, but Paragraph 2 is not included at all in the compiled output.

Setup/Environment

  • ProcessWire version: 3.0.52
  • (Optional) PHP version: 7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions