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:
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?
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.
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.
Rob1 & Chris…So sorry about the mixup in semantics of a weblog here! It can get soooo confusing!
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?
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:
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:
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.
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.
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.
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.
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:
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?
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.)
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.
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.
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>