You can change background color of the text box from Lists > "Your list" > Pages from right dropdown select Subscribe form and click on source and add custom style to div for example:Hey great guys, anyone can help me with a guild to how i can resize and change background color of the text box also color of the submit button.
<?php
Yii::app()->hooks->addFilter('frontend_list_subscribe_after_transform_list_fields', function($content){
$str = CHtml::button(Yii::t('lists', 'Subscribe'), array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'style' => "background-color:#3699FF !important; color:#ffffff"));
return str_replace('[SUBMIT_BUTTON]', $str , $content);
});
You can't do this without even the slightest knowledge of CSS.Thank you again for your help. I have tried to the best i can do as i am not great with coding and unfortunately it seems i have distorted everything by trying to configure it as you described. I noticed at first my source code was very different from the sample you sent as there was no place or anything like style=..... Anyways i only need to make it dark background with white fonts and same with the submit button. I suggest help from my backend to fix this for me please
I understand. Now I've distorted everything. Can you kindly send me the whole code of the red background you did showed me as example so i can paste it in my source area as I'm lost.
<div class="box box-primary borderless">
<div class="box-header">
<h3 class="box-title">[LIST_NAME]</h3>
</div>
<div class="box-body">
<div class="callout callout-info" style="background-color:#212E48 !important;">We're happy you decided to subscribe to our email list.<br />
Please take a few seconds and fill in the list details in order to subscribe to our list.<br />
You will receive an email to confirm your subscription, just to be sure this is your email address.</div>
[LIST_FIELDS]</div>
<div class="box-footer">
<div class="pull-right">[SUBMIT_BUTTON]</div>
<div class="clearfix"> </div>
</div>
</div>
<?php
Yii::app()->hooks->addFilter('frontend_list_subscribe_after_transform_list_fields', function($content){
$str = CHtml::button(Yii::t('lists', 'Subscribe'), array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'style' => "background-color:#212E48 !important; color:#ffffff"));
return str_replace('[SUBMIT_BUTTON]', $str , $content);
});
No worries very perfect it worked. kudosCan i use same code for the background to replace for the other forms ? example unsubscribe form
Besides for the unsubscribe button, is there a different code or how do i change thatNo worries very perfect it worked. kudos
That button will be replaced in all forms where [SUBMIT_BUTTON] tag exist.Besides for the unsubscribe button, is there a different code or how do i change that
On this template you need to change:Could kindly help me around how to make these forms with this template to have same dark color. Just where and what code to change.
<td class="darkbg" style="border-collapse:collapse;background:red">
<table align="center" border="0" cellpadding="0" cellspacing="0" id="main-table" style="-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:1px solid red;overflow:hidden;background:#FFFFFF;width:600px">
<td class="darkbg" style="padding:10px;border-collapse:collapse;background:red;">
In other words, if i will like to change the button color can i go to my web/apps and edit just the color code as shown here ?You can change background color of the text box from Lists > "Your list" > Pages from right dropdown select Subscribe form and click on source and add custom style to div for example:
View attachment 15934
To change button color you need to add your custom style using hooks, in folder: web/apps/ create file init-custom.php and then here paste bellow code:
PHP:<?php Yii::app()->hooks->addFilter('frontend_list_subscribe_after_transform_list_fields', function($content){ $str = CHtml::button(Yii::t('lists', 'Subscribe'), array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'style' => "background-color:#3699FF !important; color:#ffffff")); return str_replace('[SUBMIT_BUTTON]', $str , $content); });
These above examples will reproduce something like this:
View attachment 15935
In this code:In other words, if i will like to change the button color can i go to my web/apps and edit just the color code as shown here ?
<?php
Yii::app()->hooks->addFilter('frontend_list_subscribe_after_transform_list_fields', function($content){
$str = CHtml::button(Yii::t('lists', 'Subscribe'), array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'style' => "background-color:#212E48 !important; color:#ffffff"));
return str_replace('[SUBMIT_BUTTON]', $str , $content);
});