| Author |
Message |
webbber
Joined: 15 May 2008 Posts: 72
|
|
Url into textarea |
|
Hi guys,
I was thinking about how to add a textarea where users can copy a link code from a textarea and paste it to their websites,blogs,etc.
I have this into my template,in my index and another pages and it works:
 |  | <form>
<textarea cols="25" rows="5" class="form">
<a href="<?php $PHP_SELF; ?>" target="_blank"><b>MYWEBSITE</b>NEWS TITLE APPEARS HERE</a>
</textarea></form> |
But how can we add this into my template using CN?
I have tried many ways to get the URL visitor is reading into the textarea and still dont work.
Understand what I mean?
best regards!
|
|
| Tue May 20, 2008 1:16 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1943 Location: US |
|
|
|
Just put the {title} or whatever else you want in the <textarea> in the <textarea>, it will translate properly. Did you try it?
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Tue May 20, 2008 8:21 am |
|
 |
webbber
Joined: 15 May 2008 Posts: 72
|
|
|
|
 |  | Just put the {title} or whatever else you want in the <textarea> in the <textarea>, it will translate properly. Did you try it? |
I didn't work. I have tried many other ways.
Suggestions?
|
|
| Tue May 20, 2008 5:09 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
Put this in your template:
 |  | <textarea>{link=home/post}</textarea> |
Working great.
|
|
| Wed May 21, 2008 7:46 pm |
|
 |
webbber
Joined: 15 May 2008 Posts: 72
|
|
|
|
 |  | Put this in your template:
 |  | <textarea>{link=home/post}</textarea> |
Working great. |
I want to get something like this (when the user copy from the textarea where the link code is shown):
 |  | <a href="http//www.site.com/news/news-title.html">New title</a>
|
Hope you understand.
best regards!
|
|
| Sun May 25, 2008 5:08 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
 |  | <textarea><a href="{link=home/post}">{title}</a></textarea> |
|
|
| Thu May 29, 2008 6:09 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1943 Location: US |
|
|
|
FI-DD is right that's all you need to do but from experience I can help you to tweak that so it's a little cooler. For example, lots of sites have it auto select the code when you click it. Add this:
 |  | onFocus="this.select()" |
or in other words change:
 |  | <textarea><a href="{link=home/post}">{title}</a></textarea> |
to:
 |  | <textarea onFocus="this.select()"><a href="{link=home/post}">{title}</a></textarea> |
I can also tell you from experience that you probably don't want to use " or quote marks inside of a textarea.. instead use ' or apostraphes.. So, change the previous code to:
 |  | <textarea onFocus="this.select()"><a href='{link=home/post}'>{title}</a></textarea> |
Now you should be golden. You can add 'rows' and 'cols' to specify specific size..
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Fri May 30, 2008 12:25 am |
|
 |
webbber
Joined: 15 May 2008 Posts: 72
|
|
|
|
thank you guys, it works gr8!
Scottdallas, you told me to add this:
 |  | <textarea onFocus="this.select()"><a href='{link=home/post}'>{title}</a></textarea> |
But I use " to get doubles quotes and not simple in the URL , so i have this:
 |  | <textarea onFocus="this.select()"><a href="{link=home/post}">{title}</a></textarea> |
working gr8 now,
thnx a lot.
|
|
| Fri May 30, 2008 4:57 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1943 Location: US |
|
|
|
Ah yes you're right! That looks perfect now.
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Mon Jun 02, 2008 8:00 am |
|
 |
|