Is there any way to have each record that exports include a link to the node (just the URL as a text string) in a column? I tried adding a field as Content: Title, then setting it to Rewrite Output as link using absolute path, but all it actually pulls into the export is the name. I changed it to just Rewrite Results (without the output as link checked) and it's close - my pattern is http://www.mysite.com/content/[title]. The problem is, if you don't use the Output as Link, there's no way to use the Replace Spaces with Dashes, so what actually outputs is something like http://www.mysite.com/content/My New Node Page, instead of http://www.mysite.com/content/my-new-node-page.

Any way I can get this to work?

Comments

julescone’s picture

Hi Emmy.

I just solved this exact same issue. I had a quick search around and found your question on here and also on StackExchange I think, but couldn't find anyone offering the exact solution.

Here is how I solved it.

I added a Global: PHP field to my Data Export view (you will need the Views PHP module to make that field type available).

Then in the Output code for that Global:PHP field I entered the code below, which takes the current node id (nid) and outputs the absolute (ie: including the full domain) url for the node, using the friendly url if you have those enabled.

<?php
print url('node/'. $data->nid, array('absolute' => TRUE));
?>

That worked a treat for me. Hope that helps you as well.

Cheers, Jules

TravisCarden’s picture

@EmmyS, the module strips some or all HTML tags from fields for different export formats. See #1224894: Add an option to not strip tags from CSV export and #1868764: Don't strip hyperlinks from Excel exports.

Steven Jones’s picture

Status: Active » Fixed

This is a duplicate of #1986780: Link/Url to node and an answer to the original question is posted there.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hwasem’s picture

Issue summary: View changes

Since I've been round and round today trying to get this work, I'll add how I finally got it. In order for Excel to see the field as a real, clickable link, you have to use the Excel =hyperlink(url,name) function.

In my Drupal view, I have a title field (hidden), a PHP field using @julescone's function to get the node's url (hidden), and then a custom text field with the following:
=hyperlink("[php]", "[title]")

When the Excel file is created, these fields are links displaying only the node's title. Unfortunately they are not underlined, but they work.