Kunstmaan/KunstmaanPagePartBundle — pull request #92 by jockri (2013-08-20 13:51:24+00:00)
Title: fix: allow multiple pagepart configurations with the same context

When you have a page template with this content:

```yaml
# single-column.yml
name: "Single column page"
rows:
- regions:
- { name: "main", span: 12 }
- regions:
- { name: "footer", span: 12 }
template: "KunstmaanWebsiteBundle::Pages\\Common\\single-column-pagetemplate.html.twig"
```

You can re-use this template for different Page types, but you can specify an other pagepart configuration for each:

```php
// HomePage
public function getPagePartAdminConfigurations()
{
return array("KunstmaanWebsiteBundle:main-homepage", "KunstmaanWebsiteBundle:footer");
}

public function getPageTemplates()
{
return array("KunstmaanWebsiteBundle:single-column");
}
```

```yaml
# main-homepage.yml
name: "Main section for homepage"
context: "main"
types:
- { name: "Video", class: "Kunstmaan\\MediaPagePartBundle\\Entity\\VideoPagePart" }
```

```php
// ContentPage
public function getPagePartAdminConfigurations()
{
return array("KunstmaanWebsiteBundle:main", "KunstmaanWebsiteBundle:footer");
}

public function getPageTemplates()
{
return array("KunstmaanWebsiteBundle:single-column");
}
```

```yaml
# main.yml
name: "Main section"
context: "main"
types:
- { name: "Header", class: "Kunstmaan\\PagePartBundle\\Entity\\HeaderPagePart" }
- { name: "Text", class: "Kunstmaan\\PagePartBundle\\Entity\\TextPagePart" }
- { name: "Line", class: "Kunstmaan\\PagePartBundle\\Entity\\LinePagePart" }
- { name: "TOC", class: "Kunstmaan\\PagePartBundle\\Entity\\TocPagePart" }
- { name: "Link", class: "Kunstmaan\\PagePartBundle\\Entity\\LinkPagePart" }
- { name: "To Top", class: "Kunstmaan\\PagePartBundle\\Entity\\ToTopPagePart" }
```

In this way, the end user can only add Video pageparts in the main section of the homepage, but other pageparts in the main section of the content pages.