Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Url into textarea

 
Reply to topic    Forum Index » Help View previous topic
View next topic
Url into textarea
Author Message
webbber



Joined: 15 May 2008
Posts: 72

Post Url into textarea Reply with quote
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:

Code:
<form>
<textarea cols="25" rows="5" class="form">
<a href=&quot;<?php $PHP_SELF; ?>&quot; target=&quot;_blank&quot;><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 View user's profile Send private message
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
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 Smile
last update: 07-22-08: 8:30 pm
Tue May 20, 2008 8:21 am View user's profile Send private message Visit poster's website AIM Address
webbber



Joined: 15 May 2008
Posts: 72

Post Reply with quote
scottdallas wrote:
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 View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Put this in your template:
Code:
<textarea>{link=home/post}</textarea>


Working great.
Wed May 21, 2008 7:46 pm View user's profile Send private message
webbber



Joined: 15 May 2008
Posts: 72

Post Reply with quote
FI-DD wrote:
Put this in your template:
Code:
<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):

Code:
<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 View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Code:
<textarea><a href="{link=home/post}">{title}</a></textarea>

Thu May 29, 2008 6:09 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
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:

Code:
onFocus="this.select()"


or in other words change:

Code:
<textarea><a href="{link=home/post}">{title}</a></textarea>


to:

Code:
<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:

Code:
<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 Smile
last update: 07-22-08: 8:30 pm
Fri May 30, 2008 12:25 am View user's profile Send private message Visit poster's website AIM Address
webbber



Joined: 15 May 2008
Posts: 72

Post Reply with quote
thank you guys, it works gr8!
Scottdallas, you told me to add this:

Code:
<textarea onFocus="this.select()"><a href='{link=home/post}'>{title}</a></textarea>


But I use &quot; to get doubles quotes and not simple in the URL , so i have this:

Code:
<textarea onFocus="this.select()"><a href=&quot;{link=home/post}&quot;>{title}</a></textarea>


working gr8 now,

thnx a lot.
Fri May 30, 2008 4:57 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Ah yes you're right! That looks perfect now.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Mon Jun 02, 2008 8:00 am View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.