Next 2.3 Creating component classes (cont.) Prev
package Podius::Component::Section;

use base 'Podius::Component::Page';

sub get_own_property_types {
	return [
		[ sections    => 'ComponentCollection' , 'Section' ],
		[ products    => 'VComponentCollection', 'Product' ],
		[ articles    => 'VComponentCollection', 'Article' ],
		[ large_image => 'Image', 'images/auto/Section/default1.gif', 'Default Label' ],
		[ small_image => 'Image', 'images/auto/Section/default2.gif', 'Default Label' ],
	];
}

sub get_name {
	my $self = shift;
	return $self->phrase || $self->get_id;
}

1;
package Podius::Component::UserSet;

use base 'Podius::Component::Publishable';

sub get_own_property_types {
	return [
		[ users     => 'ComponentCollection', 'User' ],
		[ user_sets => 'ComponentCollection', 'UserSet' ],
	];
}

1;

Next Content Management with Podius Prev