1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace JoppeDc\SyliusBetterSeoPlugin\Form\Type; |
6
|
|
|
|
7
|
|
|
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; |
8
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
9
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
10
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
11
|
|
|
|
12
|
|
|
class SeoTranslationType extends AbstractResourceType |
13
|
|
|
{ |
14
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
15
|
|
|
{ |
16
|
|
|
$builder->add('pageTitle', TextType::class, [ |
17
|
|
|
'empty_data' => '', |
18
|
|
|
'label' => 'app.ui.page_title', |
19
|
|
|
'required' => false, |
20
|
|
|
]); |
21
|
|
|
|
22
|
|
|
$builder->add('ogTitle', TextType::class, [ |
23
|
|
|
'empty_data' => '', |
24
|
|
|
'label' => 'app.ui.og_title', |
25
|
|
|
'required' => false, |
26
|
|
|
]); |
27
|
|
|
|
28
|
|
|
$builder->add('ogDescription', TextareaType::class, [ |
29
|
|
|
'empty_data' => '', |
30
|
|
|
'label' => 'app.ui.og_description', |
31
|
|
|
'required' => false, |
32
|
|
|
]); |
33
|
|
|
|
34
|
|
|
$builder->add('twitterTitle', TextType::class, [ |
35
|
|
|
'empty_data' => '', |
36
|
|
|
'label' => 'app.ui.twitter_title', |
37
|
|
|
'required' => false, |
38
|
|
|
]); |
39
|
|
|
|
40
|
|
|
$builder->add('twitterDescription', TextareaType::class, [ |
41
|
|
|
'empty_data' => '', |
42
|
|
|
'label' => 'app.ui.twitter_description', |
43
|
|
|
'required' => false, |
44
|
|
|
]); |
45
|
|
|
|
46
|
|
|
$builder->add('twitterSite', TextType::class, [ |
47
|
|
|
'empty_data' => '', |
48
|
|
|
'label' => 'app.ui.twitter_site', |
49
|
|
|
'required' => false, |
50
|
|
|
]); |
51
|
|
|
|
52
|
|
|
$builder->add('extraTags', TextareaType::class, [ |
53
|
|
|
'empty_data' => '', |
54
|
|
|
'label' => 'app.ui.extra_tags', |
55
|
|
|
'required' => false, |
56
|
|
|
]); |
57
|
|
|
|
58
|
|
|
$builder->add('image', SeoImageType::class, [ |
59
|
|
|
'label' => false, |
60
|
|
|
'required' => false, |
61
|
|
|
]); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getBlockPrefix(): string |
65
|
|
|
{ |
66
|
|
|
return 'joppedc_seo_translation'; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|