1. andrejk
  2. RO CSVI
  3. Tuesday, 07 January 2025
  4.  Subscribe via email
Hello,

please, I have 38 feeds. Feeds have the same structure. I can make one tamplate and then in crone call in a loop something like:


$command_CSV_Import_Parent = "/var/www/ppp/test.sk/web/cli/; /usr/lib64/php8.0/bin/php /var/www/ppp/test.sk/web/cli/joomla.php -vv rocsvi:import --template_id=1 --key=KMJNU78JH --file="https://www.example1.sk/feed1.xml" ";


In each cycle I just change the file variable and insert another feed url. Is this possible please? Or do I need to make 38 templates?

Translated with DeepL.com (free version)

Best regards
Andrej
Accepted Answer
Accepted Answer Pending Moderation
Hi Andrej,

An the answer: No filename has been given
That is because external URLs are not supported via CLI due to needing more parameters that you can see when you edit the template to set an external URL.

So the way around this is to download the file in your script and pass the local filename as file parameter. You can use the file_get_contents function to store it as a local file and just pass that as file value in your command.

The other option is to set the URL in your template but then you need 1 template per URL, you can copy it of course. In that case you do not need to specify the URL in your command but only the correct template ID or name.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Sorry, the discussion is currently locked. You will not be able to post a reply or a comment at the moment.