1 of 2
1
Tell-a-friend form customization issues
Posted: 29 August 2005 12:47 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Hi All!

I use the tell-a-friend form {exp:email:tell_a_friend} {/exp:email:tell_a_friend} in a weblog but would like to use it
on a separate streaming video page outside of the weblog…how can this functionality be added outside a weblog?

I’ve tried to just alter the “{permalink=weblog/friend}” path to the actual template group/template and the form does open, only it is totally blank. What path or additional code is needed?Here the original link example below:

<a href=”{permalink=weblog/friend}”>Tell-a-Friend</a>

Also in the weblog the form works well except for the form opens a new browser window behind the current browser, forcing one to have to find the browser hidden behind the one they are currently on. How do you fix this?

Thanks for your help!

Best,
JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 29 August 2005 03:02 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

I don’t know what you mean by adding it “outside a weblog”.  In EE a weblog is simply a container for data; it’s your Templates that display content.

As for the form opening a window… that’s not functionality present in the default themes, so if your site does that then it’s something that you (or someone else) has added.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 29 August 2005 03:21 PM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23744
Joined  05-20-2002

Like Chris says, it doesn’t quite make sense to add it ‘outside the weblog’- so I’m a little unclear on what you are trying to do.  If you are placing the link outside a weblog TAG, there’s no id associated with the link, so nothing to display- hence the form being blank.  Basically, the stuff displayed in the form is based on the entry id for the article- which is passed in the third segment of the link to the template holding your ‘tell a friend’ code.

As to opening the form in a new window- you must be telling it to do so somewhere in your code- so either change that, or if you WANT it to open in a new window and want the window to come to the fore when opened, you can add a bit of javascript- such as

<BODY onLoad="window.focus()">

I open my ‘tell-a-friend’ stuff in a new, smaller window using js- and I tag that bit in the template where the form is so that it comes to the fore when called.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 30 August 2005 12:09 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Rob1 & Chris…So sorry about the mixup in semantics of a weblog here!  It can get soooo confusing!  confused

On my site I’m using sections “name” instead of weblog, and in addition I have a dedicated “blog” section, where the Tell-a-Friend form tags are used.

As mentioned before I made a new template group/template fto display video streams, but isn’t part of my “blog” section and I checked the path to the Tell-a-friend form which opens as a pop-up like I want but is blank… maybe you can take a look at it

By the why rob1, I added the javascript directly to the <body> of my “blog” section Tell-a-friend form, and it worked as you advertsied! final questions:

1. Since this javascript didn’t have to use a path to a separate .js code on the webserver, is this considered “in line” javascript that the browser parses or interprets? Please explain.

2. the behavior of the form takes it back behind first and THEN back to the fore…is their code I need to delete that takes it back as a default to require <BODY onLoad=“window.focus()”>, or is this normal behavior in absence of the added .js?

Thanks so much guys!

-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 30 August 2005 12:36 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

Did you add the link to the tell-a-friend form from inside the {exp:weblog:entries} tag as indicated in the user guide?

 Signature 
Profile
MSG
 
 
Posted: 31 August 2005 07:42 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Good morning LisaJill!

I’m using the same form that has the exact example {exp:weblog:entries} tag with variables shown in EE docs and that worked in the “blog” section.  The {exp:weblog:entries} tag is in the Tell-a-friend template itself, and the following Teel-a-friend link is on the page I want the user to click on:

<a href=“http://www.inspiremedia.info/index.php/see/Tell_friends/” onclick=“window.open(this.href, ‘_blank’, ‘width=340,height=500’);return false;” onkeypress=“this.onclick()”><b>Tell-a-friend!</b></a></p>
<BODY onLoad=“window.focus()”>

Please note that I’ve changed the {url_title_path=about/friend} path from what worked in the blog since its not connected to a blog post to an absolute tag so it does call the tell-a-friend form, but the <form></form> content is missing making it apear blank:

<BODY onLoad=“window.focus()”><a href=”{url_title_path=about/friend}” onclick=“window.open(this.href, ‘_blank’, ‘width=340,height=500’);return false;” onkeypress=“this.onclick()”; ><b>Tell-a-friend</b></a>


Hope this helps!

Best,
-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 31 August 2005 07:56 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

I am a bit confused - well, a lot confused.

The tell-a-friend form has to be linked from INSIDE the exp:weblog:entries tag.  Otherwise it won’t pass the article URL and therefore won’t work.  Its intention is to tell friends about articles.

 Signature 
Profile
MSG
 
 
Posted: 31 August 2005 09:21 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

O.K. Let’s get on the same page:

Here’s the tag that in the Tell-a-friend template for the “blog” section that works fine:

{exp:email:tell_a_friend charset=“utf-8” allow_html=‘n’}

<p><b><label for=“from”>Your Email Address: </label><br />
<input type=“text” id=“from” name=“from” size=“40” maxlength=“35” value=”{member_email}” /></p>

<p><label for=“name”>Your Name: </label><br />
<input type=“text” id=“name” name=“name” size=“40” maxlength=“35” value=”{member_name}” /></p>

<p><label for=“to”>Recipient’s Email Address - To: </label><br />
<input type=“text” id=“to” name=“to” size=“40” maxlength=“35” /></p>

<p><label for=“subject”>Subject: </label><br />
<input type=“text” id=“subject” name=“subject” size=“40” value=“Entry by: {author}” /></p>

<p><label for=“message”>Message: </label></b><br />
<textarea id=“message” name=“message” rows=“18” cols=“40”>


{summary}

{body}

{permalink}

</textarea></p>

<p><input name=“submit” type=‘submit’ value=‘Submit Form’ /></p>

{/exp:email:tell_a_friend}

******END*********

Now, this is the link that the user will click to open the Tell-a-friend template and form I’m refering to in the comment page:


<BODY onLoad=“window.focus()”><a href=”{url_title_path=about/friend}” onclick=“window.open(this.href, ‘_blank’, ‘width=340,height=500’);return false;” onkeypress=“this.onclick()”; ><b>Tell-a-friend</b></a>


PLEASE note that the URL path that calls theTell-a-friend template/form is {url_title_path=about/friend}. NOW I want to use this same link on a different section of my site on a normal xhtml page so I have to change that above URL path, since it won’t be associated bith my “blog”... meaning no “url_title_path”. So I’m assumingI have to change the path to an absolute path since I don’t know what else to use to point to the same or duplicate Tell-a-friend template/form.

Here’s what I used for the new path:


<a href=“http://www.inspiremedia.info/index.php/see/Tell_friends/” onclick=“window.open(this.href, ‘_blank’, ‘width=340,height=500’);return false;” onkeypress=“this.onclick()”><b>Tell-a-friend!</b></a></p>

****end***

Are you still with me?  ...and you say you’re confused!  ohh

I hope this helps, it’s hard for a newbie to explain.

Best

-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 31 August 2005 10:32 AM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

The “Tell-a-Friend” functionality is meant for use to email someone content that resides in a particular weblog entry.  That’s why the links to the tell-a-friend page need to have the URL Title or Entry ID in the URL; so tha EE knows which entry is being used.  You keep saying you want to do something “outside a weblog”, which I’m understanding to mean that your intended use has nothing to do with weblog entries.  If that’s the case, then the Tell-a-Friend functionality isn’t what you want.  Instead, you want to use a regular Contact Form that can simply send arbitrary data to a specified recipient.

Still, I think things would be clearer for us all around if you’d step back and just explain conceptually what it is you want to do, completely leaving out EE tags and variables and code and such.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 31 August 2005 11:03 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Thanks Chris,
I think you’re understanding my request now, but I had been using Tell-a-friend in weblog entries, and wanted the same functionality “outside the weblog” as I said in my first post on this subject, which I felt wasn’t a matter of “concept at this point” but re-purposing this functionality.

Now with a Contact form, I guess I could rename it to Tell-a-friend, and for the message I could add a preset message based on the subject or article sense weblog entries aren’t being used here. How would a contact form be customized & where can a find this form?  I’ve search the forum with no specific issues about this here.

Thanks Chris!

Best,

-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 31 August 2005 11:13 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

User Guide: Contact Form.

 Signature 
Profile
MSG
 
 
Posted: 31 August 2005 11:17 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Thanks LisaJill & Chris,

O.K. I’ve managed to make a pop-up form version of the contact form. i’ve tested it and the only problem is that the fields for the “friend(s) I want to tell (email recipient) doesn’t forward the message.  How would I do this? Here’s the contact form tag so far:

{exp:email:contact_form user_recipients=“false” recipients=“customer-service@inspiremedia.info” charset=“utf-8”}

<h1>Tell Friends Form</h1>

<p><label for=“from”><b>Your Email:</b>(required)</label><br />
<input type=“text” id=“from” name=“from” size=“40” maxlength=“35” value=”{member_email}” /></p>

<p><label for=“name”><b>Your Name:</b>(required)</label><br />
<input type=“text” id=“name” name=“name” size=“40” maxlength=“35” value=”{member_name}” /></p>

<p><label for=“to”><b>To a good friend:</b>(email)</label><br />
<input type=“text” id=“to” name=“to” size=“40” maxlength=“35” /></p>

<p><label for=“to”><b>To another good friend:</b>(email)</label><br />
<input type=“text” id=“to” name=“to” size=“40” maxlength=“35” /></p>

<p><label for=“subject”><b>Subject:</b> (required)</label><br />
<input type=“text” id=“subject” name=“subject” size=“40” value=“Check this out on InspireMe Online” /></p>

<p><label for=“message”><b>Message:</b></label><br />
<textarea id=“message” name=“message” rows=“18” cols=“40”>Tell Friends Email from: {member_name}
Sent at: {current_time format=”%Y %m %d”} about website: http://www.inspiremedia.info</textarea></p>

<p><input name=“submit” type=‘submit’ value=‘Submit Form’ /></p>

{/exp:email:contact_form}

Thanks for your help!

Best Regards,

JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 02 September 2005 04:52 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  140
Joined  07-31-2005

user_recipients=“true” and a hidden recipients input.

 Signature 

burningtroll

Profile
 
 
Posted: 02 September 2005 06:08 AM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Burningtroll,

Duh…I overlooked the user-reciepient value!

When you say “a hidden recipients input” could you explain? I’m assuming that you mean that:

1. The recipients=”[blank]”  instead of an email input?
2. Since I want to be notified each time the form is submitted, how & where do I include my email, now that user_recipient=true?
3. please note that this form is set up for 2 user_recipients to be submitted, but only one goes thru upon testing (only the 2nd field). What should I set the 2nd user ID to to send both “friend” emails?

Thanks for your help!

Best,

-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 02 September 2005 07:02 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  140
Joined  07-31-2005

1&2) you are the recipient in the exp tag, that’s how your notified.
3) multiple.. hmm. same input id? don’t know haven’t done it. sorry.
4) php based encription? dono. sorry.

The contact form listed in the help doc shows what I mean about the hidden recipient (bottom of page, I believe.)

 Signature 

burningtroll

Profile
 
 
Posted: 03 September 2005 08:12 PM   [ Ignore ]   [ # 15 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

burningtroll,

Thank you for clarifying the recipient issue!  As far as the multiple emails, I basically increase the # of characters one can enter in the email “To” field and
stated “separate multiple email addresses with a comma”. Upon testing multiple recipients worked fine.

Best,
-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 03 September 2005 09:32 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  140
Joined  07-31-2005

Cool, I’m sure I’ll use this for future projects. How is it “stated”?

 Signature 

burningtroll

Profile
 
 
Posted: 05 September 2005 06:57 AM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  226
Joined  04-17-2005

Hello Burningtroll,

Using the contact form example posted above (Posted: 31 August 2005 11:17 AM) , after making the User_recipent=‘true’, and a hidden recipient, the To: field (recipients) is
stated:

<p><label for=“to”><b> To:</b> (separate multiple email addresses by a comma)</label><br />
<input type=“text” id=“to” name=“to” size=“40” maxlength=“105” /></p>

which replaced both “to a good friend” recipient lines.  As long as multiple email addresses are separate by a comma, staying within the increased maxlength=”’ value, all recipients recieved the email message. Then, I renamed the contact form to “Tell friends” to reflect it’s intended new role.

Also, I added functionalityto make it a pop-up form which uses the following link and variables tp open in a separate small browser window, which stays “on top” in front of the previously opened browser (so you can find it!) using a bit of javascript ( .js donated by rob1) the entire link example seen below:

<a href=“http://www.yoursite.com/templategroup/template_with_form/” onclick=“window.open(this.href, ‘_blank’, ‘width=400,height=600’);return false;” onkeypress=“this.onclick()”>Tell all your friends-and your momma now!</a></p> <BODY onLoad=“window.focus()”>

Now, you have a nifty little Tell friends form that pops-up with a link to be embeded anywhere on a template.

Hope this answered your question.

THANK YOU ALL who helped!

Best,
-JP

 Signature 

Thanks!

Best,

-Jenn
...Just gotta have fun!

Profile
 
 
Posted: 05 September 2005 02:06 PM   [ Ignore ]   [ # 18 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  140
Joined  07-31-2005

Oh, o.k., I thought you had it inputing comma’s in via a hidden input before each email address or something. But I see now your just requesting them to type in manually.

As for the Pop-up window; You can actually just link/import a javascript command and refer it in your link, that way you don’t have to re-write for every window to open.
In the javascript file:

function openNewWindow (URLtoOpen, windowName, windowFeatures)
{newWindow=window.open (URLtoOpen, windowName, windowFeatures);
}


and then on the html file:

<a href="javascript:openNewWindow('page-to-open.htm', 'thewin', 'height=500,width=640,toolbar=no,scrollbars=yes,resize=no')">text or image here</a>


Link it in the head tag like so:

<script language="javascript 1.2" src="popup.js" type="text/javascript"> </script>

 Signature 

burningtroll

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66382 Total Logged-in Users: 67
Total Topics: 84699 Total Anonymous Users: 19
Total Replies: 454622 Total Guests: 222
Total Posts: 539321    
Members ( View Memberlist )