restored simplenews footer home block

This commit is contained in:
Bachir Soussi Chiadmi 2022-04-05 12:39:09 +02:00
parent 2b48c867ea
commit 561696635a
5 changed files with 110 additions and 3 deletions

View File

@ -0,0 +1,52 @@
uuid: 57917b98-88dc-4aab-830c-886ffa43bfb1
langcode: fr
status: true
dependencies:
module:
- context
- simplenews
- system
theme:
- materiotheme
id: simplenewssubscription
theme: materiotheme
region: footer_left
weight: 0
provider: null
plugin: simplenews_subscription_block
settings:
id: simplenews_subscription_block
label: 'Subscribe to our monthly newsletter.'
label_display: visible
provider: simplenews
newsletters:
materio_newsletter: materio_newsletter
default_newsletters:
materio_newsletter: materio_newsletter
message: ''
show_manage: true
unique_id: footersimplenewssubscriptionblock
visibility:
user_status:
id: user_status
negate: false
context_mapping:
user: '@user.current_user_context:current_user'
user_status:
viewing_profile: '0'
logged_viewing_profile: '0'
own_page_true: '0'
field_value: '0'
user_fields: uid
context_all:
id: context_all
negate: null
values: ''
context:
id: context
negate: null
values: ''
request_path:
id: request_path
negate: false
pages: '<front>'

File diff suppressed because one or more lines are too long

View File

@ -2914,6 +2914,7 @@ footer[role="contentinfo"]{
}
}
#footer-left{
// !! OLD
#block-materiosimplenewssubscription{
form{
display: flex;
@ -2958,8 +2959,40 @@ footer[role="contentinfo"]{
}
}
}
}
#block-simplenewssubscription{
display: flex;
flex-flow: row nowrap;
align-items: center;
font-size: 0.756em;
>*{
margin: 0;
margin-right: 0.5em;
}
h2{ font-size: inherit;}
form{
display: flex;
flex-flow: row nowrap;
align-items: center;
>*{
margin-right: 0.5em;
}
.form-item,
.form-actions{
margin-top: 0.3em;
margin-bottom: 0.3em;
}
#edit-subscriptions-wrapper{
display: none;
}
#edit-mail-wrapper{
.description{
display: none;
}
}
}
}
}

View File

@ -264,6 +264,28 @@ function materiotheme_form_user_login_form_alter(&$form, FormStateInterface $for
unset($form['pass']['#title']);
}
// "simplenews_subscriptions_block_footersimplenewssubscriptionblock"
function materiotheme_form_simplenews_subscriptions_block_footersimplenewssubscriptionblock_alter(&$form, FormStateInterface $form_state, $form_id) {
$form['#cache']['max-age'] = 0;
// unset($form['mail']['widget'][0]['#title']);
// $form['mail']['widget']['#attributes']['placeholder'][] = "Bon alors !";
// $form['mail']['widget']['#attributes']['placeholder'] = (string) $form['mail']['widget']['#title'];
$form['mail']['widget'][0]['value']['#placeholder'] = (string) $form['mail']['widget'][0]['value']['#title'];
$form['mail']['widget'][0]['value']['#size'] = 35;
unset($form['mail']['widget'][0]['value']['#title']);
// unset($form['mail']['widget']['#description']);
// $form['subscriptions']['widget']['#required']
// unset($form['subscriptions']['widget']['#title']);
// unset($form['subscriptions']['widget']['#description']);
$t="t";
}
function materiotheme_preprocess_block(&$variables) {
if ($variables['plugin_id'] == 'simplenews_subscription_block') {
$variables['#cache']['max-age'] = 0;
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/