SilverStripe Profileable Module
The Profileable module adds typical profile fields like address, email, profilepicture, etc to an object by extending the addressable module.
It inherits all functionality from the addressable module like automatic geocoding., (*1)
Requirements
- SilverStripe 3+
- Addressable: https://github.com/ajshort/silverstripe-addressable
Quick Usage Overview
Install the Addressable module first!
In order to add profile + address fields (name, address, suburb, city, postcode and
country, city, phone, fax, email, www, picture) to an object, simply apply to Profileable
extension:, (*2)
Object::add_extension('Object', 'Profileable');
Run dev/build and you will have a Profile tab in your backend for the extended Object., (*3)
To render the Profile just call this in your template:
$getFullProfileHTML
This will render the profile in semantic hContact mircroformat markup., (*4)
To configure the ProfilePicture Upload set this in your _config.php:, (*5)
Profileable::$ProfilePictureAllowedTypes = array('png');
Profileable::$ProfilePictureFolder = 'youruploaddir';
You can use all functionality from the addressable module like:
automatic geocoding, (*6)
Object::add_extension('Object', 'Geocodable');
Or in _config.yml:, (*7)
MyPage:
extensions:
- Profileable
- Geocodable
define a global set of allowed states or countries, (*8)
Profileable::set_allowed_countries(array('DE'=>'Deutschland'));
render a GoogleMap, (*9)
$ProfileMap(300,200)
Released under
MIT License
(i.e., do whatever you want with this and use at your own risk), (*10)