Features request for CSV Export or custom coding

By JeffC - August 9, 2016 - edited: August 10, 2016

I've noticed that that only published articles are downloaded. Would it be possible to include unpublished articles in the Export (ie items that have a publishDate set some time in the future)

If it can't be included in a future release would it be possible to show me the amend to make in the plugin file.

Would it also be possible to remove carriage returns at the end of each line in the exported CSV file. So for example this:

<h1>Title</h1>
<p>Content</p>
<p>Content</p>

Becomes this

<h1>Title</h1><p>Content</p><p>Content</p>

Lastly would it be possible to replace <anyhtml> with <p>, and </anyhtml> with </p>

So this:

<h1>Title</h1><p>Content</p><p>Content</p>

becomes this

<p>Title</p><p>Content</p><p>Content</p>

Ultimately what I am try to achieve is a document that can easily be imported into an Adobe Indesign document using a data merge. As things stand CSV files with carriage returns don't work (I think ideally a CSV is for one line of text per cell). I'm thinking if can use the CSV export plugin to get to this stage: <p>title</p><p>content</p><p>content</p>, when in Indesign I will be able to easily identify where the paragraph breaks are needed and it will be a simple job of removing the final tags with find and replace.

Thanks in advance
Jeff

Jeff

By Damon - August 12, 2016

Hi Jeff,

I've noticed that that only published articles are downloaded. Would it be possible to include unpublished articles in the Export (ie items that have a publishDate set some time in the future)

In CSV Export 1.04, it includes this in the export as an option:
- Records are now included with export even if they are hidden
- Records are now included with export even if they have publish or remove dates
- Records are now included with export even if they are owned by disabled users

Open csvExport.php in a code editor. Starting on line 87, set the following to be true as needed:

'ignoreHidden'            => true, // don't hide records with hidden flag set
'ignorePublishDate'       => true, // don't hide records with publishDate > now
'ignoreRemoveDate'        => true, // don't hide records with removeDate < now
'includeDisabledAccounts' => true, // include records that were created by disabled accounts. See: Admin > Section Editors > Advanced > Disabled Accounts

For removing carriage returns and replacing html tags with paragraph tag, we would have to write some custom code. There are a lot of html tags with attributes that would need to be taken into account.

Can you send an email into Ross at consulting@interactivetools.com with details and he can discuss the requirments further.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By JeffC - August 15, 2016

Thanks Damon

I noticed the new features listed in the changelog, but didn't realise the default setting was 'false'.

I'll email Ross about the other requirements.

Jeff