Build pages by importing CSV?
PermalinkI have to create pages for aprox 500 books (coverpic, title, author, publishing house, year, town, infolink) below a special point in our site. In the past, we built the pages by using a template and a design. But we built just three our four a day - since a couple of years.
Now we need to rebuild ALL thoose pages in one step.
I found that tool to create a bulk of pages by a textlist, but I cannot add any attributes into them. Can anybody help me?
Best
Mathias
Community member hissy has created several packages that I believe are related to what you are trying to do. One package converts CSV into the concrete5-cif XML format. The other add-on imports the concrete5-cif XML data into your concrete5 5.7 site.
I believe the packages may require some customization to meet your needs though. Do you have any programming experience? If not, are you looking for a developer referral?
CIF Importer
https://www.concrete5.org/marketplace/addons/cif-importer1...
CSV to XML Converter Add-On for concrete5
https://github.com/hissy/addon_csv_xml_converter...
An unexpected error occurred. Concrete\Package\CsvXmlConverter\Controller::registerAutoload(): Failed opening required '/home/anbk/public_html/packages/csv_xml_converter/vendor/autoload.php' (include_path='/home/anbk/public_html/concrete/vendor:.:/usr/lib/php:/usr/local/lib/php')
Please help me bringing back my website to live!
I actually managed to solve the above issue by changing the following line in the package controller.php file.
FROM:
require_once(__DIR__ . '/vendor/autoload.php');
TO:
require_once(__DIR__ . '/../../concrete/vendor/autoload.php');
Then it worked well and I managed to upload the csv file. Now, when I clicked on convert, I got the below error:
Class 'parseCSV' not found
Any idea?
I'm afraid, I am not able to help you, because I didn't use the recommended tools until today. Maybe your host-company offers a backup-service, that can recreate the complete website. I will setup a brand new system to try out the packs.
Best wishes
Mathias
I don't recommend you to rely on the csv to xml converter.. it's buggy.
I will keep you posted, if I managed to figure out.
I also decided not to use that package. I will insert a external mysql database. That works fine and it is pretty easy to put the PHP-Code into a C5 theme.
In the beginning C5 was very nice for me, but meanwhile I spotted several insufficiencies, which cannot be removed without a huge assignment of time. The impossibility of the import of several items in one step, will remain to be the major problem of C5.
Or could it be a solution to abuse/modify a C5-shop-system?
Best Mathias
Thanks
PS this is from
https://github.com/hissy/addon_csv_xml_converter/blob/master/csv_xml...
<?php namespace Concrete\Package\CsvXmlConverter\Controller\SinglePage\Dashboard\System\Backup; use Core; use File; use Concrete\Core\File\Importer as FileImporter; use Concrete\Block\Content\Controller as ContentBlockController; class CsvXml extends \Concrete\Core\Page\Controller\DashboardPageController { const PREFIX_PAGE = 'page_'; const PREFIX_ATTR = 'attr_'; const PREFIX_FILE = 'file_'; const PREFIX_SELECT = 'select_'; const PREFIX_BLOCK = 'block_'; public function convert() { if ($this->token->validate("convert")) { $valn = Core::make('helper/validation/numbers');
are these entirely new listings/pages or are you copying from one site to another? Or upgrading from 5.6 to 5.7 etc?
What version of Concrete5 are you using?