Global Blocks and Page Types

Permalink
Let's say that I want to create a directory that lists various companies. So I create a custom block called Company Info. The block includes a few mandatory fields, such as company name.

Now, I want to have a page type called Company Listing which automatically includes a Company Info block. So I create the page type in the dashboard, and under Output, I add the Company Info block.

However, when I add the block, it forces me to fill in the mandatory fields, and creates a global block - a specific instance of the Company Info block - which is placed on all pages of this type.

Am I doing this right? Is there a way to place a "blank" Company Info block into the page type? Or should I require my users to place the block themselves, after page creation?

barmint
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi barmint,

You could try this:
- create the Company Info block
- make sure the Company Info block has a composer.php file, so it can be used in Composer
Example: basic composer.php file that will display the form.php view
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('form.php', array('view' => $view));

- create the Company Listing page type (make sure that "Launch in Composer?" is set to yes)
- when you add form controls in Edit Form, make sure Company Info is added
- when editing the page defaults, make sure you use the Composer Control block to place Company Info on the page
- make sure that you place the Composer Control block in a non-global area

After doing this, you should be able to create a new Company Listing page that opens in Composer. In Composer, you will have the Company Info block fields to type in. When you publish, the Company Info block will be populated with the data you filled into Composer.
barmint replied on at Permalink Reply
barmint
Thank you!

When I create the page, it now asks me for both the page and block information - very nice.