setAll([ 'has_dashboard', 'can_register', 'keep_stats', 'can_favourite', 'member_verified', ]) ->setCreatable([ 'piercer' => ['piercings','artwork','events'], 'tattoo_artist' => ['tattoos','artwork','events'], 'artist' => ['artwork'] ]) ->setUserSubtype('artist_type'); $artist->profile() ->setIcon('artist') ->make([ 'rewrite' => [ 'slug' => 'artist', 'with_front' => false, ], 'taxonomies' => [ 'art_form', 'art_style', 'art_theme', 'artist_type', 'city', 'colours', 'shop', 'style', 'theme', ], 'hierarchical' => false, ]) ->setAll([ 'favouritable', 'karma', 'show_feed', 'show_directory', 'approve_new', 'invitable', 'track_changes', ]); //$directory = $artist->getConfig('directory'); } function aei_artist_fields():void { if (!class_exists('JVBase\registrar\Registrar')) { return; } $artist = Registrar::getInstance('artist'); $profile = $artist->getProfile(); $fields = $profile->fields(); $fields->addField('display_name', [ 'type' => 'text', 'label' => 'display_name', 'required' => true, ]); $fields->addField('first_name', [ 'type' => 'text', 'label' => 'First Name', 'required' => true, ]); $fields->addField('phone', [ 'type' => 'phone', 'label' => 'Phone' ]); $fields->addField('email', [ 'type' => 'email', 'label' => 'Email' ]); $fields->addCommon('links'); $fields->addCommon('contact'); $fields->addField('followers', [ 'type' => 'repeater', 'label' => 'Social Followers', 'hidden' => true, 'fields' => [ 'count' => [ 'type' => 'text', 'subtype'=> 'number', 'label' => 'Count' ], 'source' => [ 'type' => 'select', 'label' => 'Source', 'options' => [ 'instagram' => 'Instagram', 'facebook' => 'Facebook', 'tiktok' => 'TikTok', 'general' => 'General', ] ], 'checked' => [ 'type' => 'date', 'label' => 'Lst Checked' ] ] ]); $fields->addField('insta_handle', [ 'type' => 'text', 'hidden' => true, 'label' => 'Instagram Handle' ]); $fields->addField('show_online', [ 'type' => 'true_false', 'label' => 'Show Online', ]); $fields->addField('featured_artist', [ 'type' => 'true_false', 'label' => 'Featured Artist', 'hint' => 'Would you like a chance to be a featured artist?', ]); $fields->addField('has_discounts', [ 'type' => 'true_false', 'label' => 'Discounts', 'description' => 'Do you offer discounted or free services to those leaving domestic violence, gangs, covering hateful imagery, or trafficking? This will NOT be posted anywhere publicly. We work with local non-profits for our New Legacy Program, and we want to know who we can refer to. Some non-profits may have discretionary funds to put towards these services.', ]); $fields->addField('discounts', [ 'type' => 'repeater', 'label' => 'What do you offer?', 'fields' => [ 'for' => [ 'type' => 'text', 'label' => 'For: ', 'hint' => 'Who is this for? Example: hateful symbolism, domestic violence, prison tattoos, gang tattoos, scars, human trafficking, etc' ], 'description' => [ 'type' => 'textarea', 'quill' => true, 'label' => 'What do you offer?', 'hint' => 'What do you offer? Discount/pro bono/sliding scale? What are the conditions?' ] ] ]); $fields->addField('top_style', [ 'type' => 'selector', 'subtype'=> 'taxonomy', 'isReference' => true, 'taxonomy' => 'style', 'max' => 3, 'label' => 'Top Styles (Max 3)', 'hint' => 'If you want to control which 3 styles show at the top of your profile, select your top favourite styles to work in. If you do not select any, it will be determined by the tattoo styles you post most often.' ]); $fields->addField('top_theme', [ 'type' => 'selector', 'subtype'=> 'taxonomy', 'isReference' => true, 'taxonomy' => 'theme', 'max' => 3, 'label' => 'Top Themes (Max 3)', 'hint' => 'If you want to control which 3 themes show at the top of your profile, select your top favourite styles to work in. If you do not select any, it will be determined by the tattoo themes you post most often.' ]); $fields->addField('city', [ 'type' => 'selector', 'subtype' => 'taxonomy', 'taxonomy' => 'city', 'label' => 'City', ]); $fields->addField('shop', [ 'type' => 'selector', 'subtype' => 'taxonomy', 'taxonomy' => 'shop', 'label' => 'Shop', ]); $fields->addField('requested_shop', [ 'type' => 'selector', 'subtype' => 'taxonomy', 'isReference' => true, 'taxonomy' => 'shop', 'label' => 'Requested Shop', 'hidden' => true, ]); //TODO These two should probably be auto-added via management settings $fields->addField('shop_owner',[ 'hidden' => true, 'type' => 'selector', 'subtype' => 'taxonomy', 'taxonomy' => 'shop', 'isReference' => 'true', 'label' => 'Shop Owner', ]); $fields->addField('shop_manager',[ 'hidden' => true, 'type' => 'selector', 'subtype' => 'taxonomy', 'taxonomy' => 'shop', 'isReference' => 'true', 'label' => 'Shop Manager', ]); $fields->modifyField('post_excerpt', 'label', 'Short Bio'); $fields->modifyField('post_excerpt', 'maxLength', 133); $fields->modifyField('post_excerpt', 'description', 'A short description of yourself. 1-3 sentences.'); $fields->modifyField('post_content', 'label', 'Bio'); $fields->modifyField('post_content', 'quill', true); $fields->modifyField('post_content', 'description', 'A longer bio for your main profile.'); $fields->addField('image_portrait', [ 'type' => 'upload', 'label' => 'Profile Image' ]); $fields->addField('artist_type', [ 'type' => 'selector', 'subtype' => 'taxonomy', 'taxonomy' => 'artist_type', 'max' => 1, 'label' => 'You are a:' ]); // $fields->addCommon('wiki'); // $fields->addCommon('alternate_name'); // $fields->addCommon('specialties'); // $fields->addCommon('rate'); // $fields->addCommon('awards'); // $fields->addCommon('ratings'); // $fields->addCommon('reviews'); // $fields->addCommon('services'); // $fields->addCommon('languages'); // $fields->addCommon('credentials'); // $fields->addCommon('keywords'); $contact = $profile->addSection('contact') ->setIcon('chat') ->setFields([ 'display_name', 'first_name', 'phone', 'email', 'public_contact', 'admin_contact', 'show_online', 'featured_artist', ]); $profileSection = $profile->addSection('profile') ->setIcon('user') ->setFields([ 'image_portrait', 'artist_type', 'city', 'shop', 'post_excerpt', 'post_content' ]); $seo = $profile->getSEO(); // $seo = $profile->addSection('seo') // ->setIcon('robot') // ->setFields([ // 'alternate_name', // 'specialties', // 'rate', // 'awards', // 'ratings', // 'reviews', // 'services', // 'languages', // 'credentials', // 'keywords' // ]); } function aei_artist_schema():array { return [ 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\WebPage\ProfilePage', 'name' => '{{post_title}} | Edmonton\'s Best {{artist_type.name}}', 'about' => [ 'type' => 'JVBase\managers\SEO\render\Thing\Person', 'name' => '{{post_title}}', 'givenName' => '{{first_name', 'description' => '{{post_excerpt}}', 'memberOf' => ['@id' => get_home_url().'/#organization'], 'alternateName' => '{{alternate_name}}', 'workLocation' => '{{city}}' ], 'description' => '{{post_excerpt}}', ]; } add_filter('jvb_single_artit_profile_schema_output', 10, 2); function aei_artist_schema_output(ProfilePage $profile, int $ID):ProfilePage { $person = $profile->getAbout(); $meta = Meta::forPost($ID); $public_contact = $meta->get('public_contact'); foreach ($public_contact as $c) { switch ($c) { case 'text': case 'call': $phone = $meta->get('phone'); if (!empty($phone)) { $person->setTelephone($phone); } break; case 'email': $email = $meta->get('email'); if(!empty($email)) { $person->setEmail($email); } } } $links = $meta->get('links'); $sameAs = []; foreach($links as $link) { $sameAs[] = $link['url']; } if (!empty($links)) { $person->setSameAs($sameAs); } //TODO: Rating is not a property of Person // $rating = $meta->get('average_rating'); // if (!empty($rating) || $rating === 'none') { // $total = $meta->get('total_ratings'); // $person->setAggregateRating([ // 'ratingValue' => $rating, // 'ratingCount' => $total === '' ? 1 : $total, // 'bestRating' => 5, // 'worstRating' => 1, // ]) // } return $profile; } function aei_artist_meta():array { return[ 'name' => 'Best Tattoos in {{name}}', 'description' => 'Tattoos, piercings, tattoo artists, and tattoo artists in {{name}}.' ]; } function aei_artist_archive(array $defaults):array { return array_merge($defaults, [ 'name' => '{{name}}\'s Best Tattoo Artists', ]); } function aei_artist_reference_schema(array $defaults):array { return $defaults; }