This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
    KurtJensen
    
            
            
                    
                                            
        
    
        How do I create a page, layout, OR Content that will include components when someone installs my plugin?
I want to make it easy for users to create a page with multiple components that work together from my plugin on a page with tabs etc. without them having to type it out.
They can then edit it as they see fit but I give them a nice starting point.
    daftspunky
    
            
            
                    
                                            
        
    
        Here is an example of how you might create a partial from a seed file:
use File;
use Cms\Classes\Partial;
/**
 * Creates a partial using the contents of a specified file.
 * @param  string $name      New Partial name
 * @param  string $filePath  File containing partial contents
 * @param  string $themeCode Theme to create the partial
 * @return void
 */
protected static function createPartialFromFile($name, $filePath, $themeCode)
{
    if (!File::exists($filePath))
        return;
    $partial = new Partial($themeCode);
    $partial->fill([
        'fileName' => $name,
        'markup' => File::get($filePath)
    ]);
    $partial->save();
}
                    1-3 of 3