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?

Comments

RobLoach’s picture

We could do a number of things:

  1. Contribute exportnode module (not recommended since Services is the best way to do this)
  2. Use the Services module, along with GET Server to export the nodes as text, but then we still have the problem of how do we provide the menu item?
  3. Create a DrupalBin_Helper module that would take care of this

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?

dangarc’s picture

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.

christefano’s picture

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.

RobLoach’s picture

Title: Download or Exportnode function » GeSHi Node: Link to Download Code
Project: DrupalBin » GeSHi Filter for syntax highlighting
Version: 5.x-1.x-dev » 6.x-1.x-dev

Great idea, christefano. I'll move this issue to the Geshi module and sometime put together a patch to add the link.

Undefined.za’s picture

subscribing...

leprechau’s picture

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:
$node_field[0]['value'] = str_replace('<!--break-->','',trim($node->body));

Display Format:
$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

leprechau’s picture

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

yukare’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This issue is a lot outdated, but is an interessing feature, if someone want work again please reopen this.