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
Comment #1
julescone CreditAttribution: julescone commentedHi 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.
That worked a treat for me. Hope that helps you as well.
Cheers, Jules
Comment #2
TravisCarden CreditAttribution: TravisCarden commented@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.
Comment #3
Steven Jones CreditAttribution: Steven Jones commentedThis is a duplicate of #1986780: Link/Url to node and an answer to the original question is posted there.
Comment #5
hwasem CreditAttribution: hwasem commentedSince 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.