0

I am trying to create dynamic feeds from config/feed-me.php with following code:

$files = glob("/feeds/*xml");
if (is_array($files)) {
    $cnt = 1;
     foreach($files as $key => $filename) {
        $ar = explode('/', $filename);
        $feedUrl[$cnt] = [
            'name' => end($ar),
            'feedUrl' => $siteUrl . '/REAXML/' . end($ar),
            'feedType' => 'xml',
            'elementType' => 'craft\elements\Entry',
            'duplicateHandle' => ['add', 'update', 'disable'],
            'passkey' => 'BvqhIGn4F' . $cnt,
            'backup' => 1,
        ];
        $cnt++;
     }
}

return [
    '*' => [
        'pluginName' => 'Feed Me',
        'cache' => 60,
        'requestOptions' => [],
        'skipUpdateFieldHandle' => 'skipFeedMeUpdate',
        'backupLimit' => 100,
        'dataDelimiter' => '-|-',
        'csvColumnDelimiter' => '',
        'parseTwig' => false,
        'compareContent' => false,
        'sleepTime' => 0,
        'logging' => false,
        'runGcBeforeFeed' => false,
        'queueTtr' => 300,
        'queueMaxRetry' => 5,
        'assetDownloadCurl' => true,
        'feedOptions' => $feedUrl,
    ]
];

But no feed is showing with message No feeds exist yet. Not sure, if we can create feeds from config/feed-me.php file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.