1 achillis Feb 13, 2017 17:32
3 fplanque Feb 16, 2017 18:22
We have this widget in the works already in some branch. I will pop up in a future release.
4 achillis May 24, 2017 09:06
I actually made a plugin instead, however please can the dev provide the ability to specify a custom template path for the
_contact_msg.form.php
inanon_async.php
something like:
case 'get_msg_form':
// display send message form
$recipient_id = param( 'recipient_id', 'integer', 0 );
$recipient_name = param( 'recipient_name', 'string', '' );
$subject = param( 'subject', 'string', '' );
$email_author = param( 'email_author', 'string', '' );
$email_author_address = param( 'email_author_address', 'string', '' );
$redirect_to = param( 'redirect_to', 'url', '' );
$post_id = NULL;
$comment_id = param( 'comment_id', 'integer', 0 );
$BlogCache = & get_BlogCache();
$Collection = $Blog = $BlogCache->get_by_ID( $blog_ID );
$template_path = param( 'template_path', 'string', '' );
locale_activate( $Blog->get('locale') );
if( $recipient_id > 0 )
{ // Get identity link for existed users
$RecipientCache = & get_UserCache();
$Recipient = $RecipientCache->get_by_ID( $recipient_id );
$recipient_link = $Recipient->get_identity_link( array( 'link_text' => 'nickname' ) );
}
else if( $comment_id > 0 )
{ // Anonymous Users
$gender_class = '';
if( check_setting( 'gender_colored' ) )
{ // Set a gender class if the setting is ON
$gender_class = ' nogender';
}
$recipient_link = '<span class="user anonymous'.$gender_class.'" rel="bubbletipcomment'.$comment_id.'">'.$recipient_name.'</span>';
}
$blog_skin_ID = $Blog->get_skin_ID();
if( ! empty( $blog_skin_ID ) )
{ // check if Blog skin has specific concact message form
$SkinCache = & get_SkinCache();
$Skin = & $SkinCache->get_by_ID( $blog_skin_ID );
$ads_current_skin_path = $skins_path.$Skin->folder.'/';
}
if( ! empty( $template_path) && file_exists( $template_path) )
{ // Template file exists for the current form
require $template_path;
}
else {
require skin_template_path( '_contact_msg.form.php' );
}
break;
@fplanque please can you look at this and give the ability to specify a custom template path in anon_async.php
5 achillis May 24, 2017 09:08
//anon_async.php
case 'get_msg_form'
$template_path = param( 'template_path', 'string', '' );
if( ! empty( $template_path) && file_exists( $template_path) )
{ // Template file exists for the current form
require $template_path;
}
else {
require skin_template_path( '_contact_msg.form.php' );
}
6 mgsolipa May 27, 2017 09:40
@achillis just a question, why do you need the template path to be configurable? I can figure it out, but can you please give us an example of how are you using this (or how are you planning to use it)? Thank you.
7 achillis May 27, 2017 14:32
Please see related thread as it explains it in context
http://forums.b2evolution.net/display-event-for-containers
I am happy to provide more info if you need clarification.
8 fplanque Aug 03, 2017 22:03
@achillis @mgsolipa We cannot guarantee that any of the contact form handling code will remain like this and we cannot add customization options that do not support the direction we are going in.
Besides making the form a widget, another thing we are currently working on is the ability to configure which fields (including custom fields) go into the contact form. This configuration will be done in the back-office. This means we are rewriting the code that displays the contact form(s) pretty heavily.
One question emerges: do we need one contact form per collection or even per site or do we potentially need several different contact forms for a single collection? (in the latter case, a use case description would be appreciated)
I actually made a plugin instead, however please can the dev provide the ability to specify a custom template path for the
_contact_msg.form.php
inanon_async.php
something like: