Download & Extend

How to display code for widgets so users can copy&paste?

Project:Drigg
Version:5.x-2.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Im trying to display code for widgets in one of the blocks so users can coopy to their sites ti dispaly my sites widgets, but simpe thing doesnt work, any suggestions? thx

Comments

#1

I meant code tag

#2

use textarea html tags. take example on youtube or other site where they provide html code to copy and paste.

#3

I do have the code but when I paste it in the block it displays as an image, but I want to display code itself.

#4

I mean, put the code INSIDE a textarea input field.
look at the html source code of websites offering an html code to copy and paste and search how they've done it.
Then do the same in your page or in a block. Make sure you select the input format of your page or block to be Full HTML or PHP.

#5

oh ok thanks Ill give it a try

#6

so I've tried youtube but it didnt work. but I got this code off the digg site and it worked but still displays the button image inside the code.

this is the digg tags.

<div class="integrate-url">
&lt; &gt;

</div>

and this is the code for my button

<a href="javascript:q=(document.location.href);t=(document.title);void(open('http://www.sample.com/node/add/drigg?url='+escape(q)+'&title='+escape(t),'','resizable,location,menubar,toolbar,scrollbars,status'));" title="Add scoop" alt="Add scoop"><img src="imageurl.com" alt="Add scoop"/></a>

#7

<textarea style="width:100%; height:40px;" onFocus="this.focus();this.select();" readonly><a href="javascript:q=(document.location.href);t=(document.title);void(open('http://www.sample.com/node/add/drigg?url='+escape(q)+'&title='+escape(t),'','resizable,location,menubar,toolbar,scrollbars,status'));" title="Add scoop" alt="Add scoop"><img src="imageurl.com" alt="Add scoop"/></a></textarea>

Good luck for the rest of your journey because you don't seem to know much about basic html, everyone's got to learn something..

#8

Got to start somewhere, thanks.

#9

and the story body ?

nobody click here