GeSHi Node: Link to Download Code
dangarc - February 14, 2008 - 15:06
| Project: | GeSHi Filter for syntax highlighting |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
In drupalbin.com, there is an exportnode function that saves the node as a txt file. In my build of drupalbin, that feature is missing from the tabs. Has anybody gotten the exportnode feature to work? and if so, how?

#1
We could do a number of things:
DrupalBin_Helper is probably the best way to go, as it means that we could add other functionality later on as we see fit. Any thoughts?
#2
I agree, the helper module is definitely the best way to go for this.
Since it seems that your solution is a custom one, just a general question:
In my build, I actually rolled out the DrupalBin as a secondary feature to the site-- Content creation is still the focus, but drupalbin is necessary. Will the refocusing to the frontpage instead of geshinode affect the exporting functions, or is it as simple as just stating only code nodes will export?
By the way, your webcast on Services and .net was incredible.
#3
Is there a reason that the Export Node module (or at least the Export Node Text module) isn't part of the geshinode module? They're a perfect fit.
In any case, I think the download link should be in the node links and not presented as a tab. As far as I can tell, node links are traditionally used for actions while tabs are used to reveal different facets of a node.
#4
Great idea, christefano. I'll move this issue to the Geshi module and sometime put together a patch to add the link.
#5
subscribing...
#6
I have a workaround for this that I use on my personal website where I just create a text area below the geshi node with the plain text body inserted where users can copy/paste....to recreate:
1) make sure you have downloaded and installed the 'Computed Field' module
2) Goto: Administer -> Content Types -> Source Code Node -> Manage Fields
3) Add a new field called 'Plain Text' ... name ... 'field_body_text' ... type ... 'Computed' ... save it
4) In the computed field settings (do not include php tags):
Computed Code:
<?php$node_field[0]['value'] = str_replace('<!--break-->','',trim($node->body));
?>
Display Format:
<?php$display = '<textarea rows="20" cols="160" readonly="readonly">' . $node_field_item['value'] . '</textarea>';
?>
DO NOT STORE IN DATABASE! .. save it...
5) Goto 'Display Fields' and on 'Basic' tab
Label: Above
Teaser:
Full Node: Raw text
Now for the rest of the tabs RSS, Search, Print, etc... just check the 'Exclude' boxes
6) There you go...you now have a plain text simple copy/paste area for all your users to view....to see an example check out my site
http://woodstock.anbcs.com
-- Aaron
#7
I have improved on the above by alot...I know have actual working fully automated download links on my website for all my source code nodes...you can read about it here: http://woodstock.anbcs.com/node/73