V-K
V-K

Reputation: 1357

Typo3 insert plugin news from Typoscript

I want to insert plugin tx_news above footer on all my pages. In previous version CMS I could do it through typoscript:

lib.news < plugin.tt_news
lib.news {
    templateFile=fileadmin/templates/news_template.tmpl
    code >
    code = LATEST
    catImageMode = 0
    catTextMode = 0
}

But in new version I don't know how to configurate plugin from typoscript. Please, help me to solve this problem. UPD

lib.news = USER
lib.news {
  userFunc = tx_extbase_core_bootstrap->run
  extensionName = News
  pluginName = Pi1

  switchableControllerActions {
        News {
          1 = list
        }
  }

  settings < plugin.tx_news.settings
  settings {
        //categories = 49
        limit = 30
        detailPid = 31
        overrideFlexformSettingsIfEmpty := addToList(detailPid)
        startingpoint = 13
  }
}

it doesn't work, source:link

tx_news version 4.2.1. When I insert the plugin on the page with the admin panel , it works. But when When I insert the plugin on the page with the typoscript , I don't know if it is initialize. I've tried all ways from docs, but I haven't anything on the page.

Upvotes: 0

Views: 683

Answers (1)

Georg Ringer
Georg Ringer

Reputation: 7939

Take a look at the related chapter in the news https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/IntegrationWithTypoScript/Index.html.

The problem is (I guess) that you don't use the namespace version of the bootstrap class.

An example:

lib.news = USER
lib.news {
  userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
  extensionName = News
  pluginName = Pi1
  vendorName = GeorgRinger

  switchableControllerActions {
    News {
      1 = list
    }
  }

  settings < plugin.tx_news.settings
  settings {
    //categories = 49
    limit = 30
    detailPid = 31
    overrideFlexformSettingsIfEmpty := addToList(detailPid)
    startingpoint = 13
  }
}

Upvotes: 1

Related Questions