Get page header and footer preview in backend - typo3

I have created a TYPO3 plugin to add new content columns to tt_content.
I need the header and footer content for my preview page in the backend. Once i get the header and footer I can show my contents in between this.
I want to insert some edit features in the content area. that is why I need the html rendered output to a php variable.
I am using templavoila.
I tried this - but got an error:
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
$conf = array('userFunc' => 'tx_templavoila_pi1->main_page');
$content = $this->cObj->USER($conf);
#1316104317: The default controller for extension "myplugin" and plugin "ContentRenderer" can not be determined. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.

You can use this TypoScript :
10 = USER
10 {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = EXTNAME
controller = CONTROLLERNAME
action = ACTION
}
Just replace EXTNAME, CONTROLLERNAME, ACTION.

Related

how can i hide the read more links in typo3 (7.6.23) using tx_news (6.1.1)

I need to hide the more link in the news_list when cropMaxCharacters exceed the maximum characters in a news.
Is it possible via typoscript template setup?
This is my typoscript template for the news page.
plugin.tx_news.settings {
startingpoint = 128
list.paginate.itemsPerPage = 10
cropMaxCharacters = 9999
}
lib.news = USER
lib.news {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = Pi1
vendorName = GeorgRinger
extensionName = News
controller = News
settings =< plugin.tx_news.settings
persistence =< plugin.tx_news.persistence
view =< plugin.tx_news.view
}
lib.news_list < lib.news
lib.news_list {
action = list
switchableControllerActions.News.1 = list
}
lib.news_detail < lib.news
lib.news_detail {
action = detail
switchableControllerActions.News.1 = detail
}
[globalVar = GP:tx_news_pi1|news > 0]
page.100.10.20 = COA
page.100.10.20.10 < lib.news_detail
[else]
page.100.10.20 = COA
page.100.10.20.10 < lib.news_list
[end]
cropMaxCharacters is set that heigh, because i want to have all news with their complete text.
If there is a way to show all news on one page in detailed view i'd be interested in that, too.
Your wishes can come true. but not so much with typoscript but with fluid.
As other extensions ext:news uses fluid templates which can be selectively(!) been replaced.
First add your pathes to the rootpathes:
plugin.tx_news {
view {
layoutRootPaths.10 = EXT:site_ext/Resources/Private/news/Layouts
partialRootPaths.10 = EXT:site_ext/Resources/Private/news/Partials
templateRootPaths.10 = EXT:site_ext/Resources/Private/news/Templates
}
}
This will define alternative pathes for templates.
Now you need to copy the original Templates you want to modify from the subdir in the news extension into your folders.
Then you need to modify the templates.
The template for the list view could be found with the path Templates/News/List.html. the single news are rendered in the partial partial/List/Item.html. There you can find the usage of the viewhelper f:format.crop and the more link (look for the text "more-link")
If you want a complete listing of all news with full text you could replace the item partial with a copy of the template from the detail-view.

TYPO3 insert plugin on every pages

I have TYPO3 version 7.6.18. I want to insert some plugin in every pages, I think it may be do with typoscript? Help me please, how to do it ?
If you want to insert a specific plugin on every page, you can simply add it to your page like so:
page = PAGE
page{
10 = FLUIDTEMPLATE
10{
# the fluid template settings
}
# add a fixed plugin to be rendered after the normal fluid template
20 = USER
20{
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = MyExt
vendorName = MyVendor
pluginName = Pi1
switchableControllerActions{
TheController{
0 = actionName
}
}
}
}
This basically adds a new section to your page rendering that only renders your plugin.
You could also load the plugin into lib and render it in your FLUID template.
TypoScript
lib.myPlugin = USER
lib.myPlugin {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = MyExt
vendorName = MyVendor
pluginName = Pi1
switchableControllerActions{
TheController{
0 = actionName
}
}
}
FLUID template
<f:cObject typoscriptObjectPath="lib.myPlugin"/>

How can I access to Flexform Settings when I embed my plugin over TypoScript

I embed a TYPO3 plugin via typoscript and everything is ok. I can access to the TypoScript Settings but not to Flexform Settings. here is my code:
temp.mCOA = USER
temp.mCOA {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = ExtensionName
pluginName = Pi1
vendorName = Vendor
controller = MyController
action = list
switchableControllerActions {
MyController {
1 = list
}
}
view < plugin.tx_extensionname_pi1.view
persistence < plugin.tx_extensionname_pi1.persistence
settings < plugin.tx_extensionname_pi1.settings
}
Can Someone help me Please?
thank you in advance for your help.
If you set your extension within typoscript there is no FlexForm. The FlexForm belongs to an Content Element.
Settings to the typoscript embeded version must be put into the plugin.tx_extensionname_pi1.settings scope per TypoScript.
With Flexform you can provide the abilty to your users to override typoscript settings when they put an new content element with your plugin onto an page.

New page type calling plugin through Typoscript

I've created a new page type with doktype = 150, and want all pages of this type to call a plugin. What is the correct way to do this using Typoscript? This is what I've got so far:
[page|doktype = 150]
# Typoscript for page type 150, product plugin
prod_page = PAGE
prod_page {
typeNum = 1 <-- I want this to be 0!
10 = COA
10 < tt_content.list.20.products_pi1 <-- Calls default plugin action.
20 = TEXT
20 {
stdWrap.field = productid <-- Want to use productid with plugin action.
stdWrap = <p>|</p>
}
}
[global]
If I change typeNum to 0, the plugin won't be rendered. Do you know why?
I also would like to know how to change the action called be the plugin. Now the default action is called, which is not what I want. Rather, I want another action show to be called with product id = productid from the page record.
Grateful for your help.
Shouldn't the typeNum be equal to the doktype? What happens if you leave the setting away?
Also, I'm not sure if you're on the right path with how you embed your plugin.
[page|doktype = 150]
# Typoscript for page type 150, product plugin
prod_page = PAGE
prod_page {
10 < plugins.my_plugin
// 10.settings.productid.data = GPvar:productid // just phantasizing here
}
[global]

How to hide a plugin's title via Typoscript when rendering with css_styled_content

This is probably very basic, but I'm stuck.
In TYPO3 6.1.x with tx_news, I have configured the news detail view to appear on the same page as the list view as taught on http://docs.typo3.org/typo3cms/extensions/news/latest/Main/Tutorial/IntegrationWithTs/Index.html
Also, I have pulled in the news'header as h1 as such
temp.h1 = COA
temp.h1 {
10 = TEXT
10 {
value = <h1>{page:title}</h1>
insertData = 1
}
10 = RECORDS
10 {
if.isTrue.data = GP:tx_news_pi1|news
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
htmlSpecialChars = 1
}
wrap = <h1>|</h1>
}
}
What I couldn't solve yet is that the plugin element has a title (in the regular "header" field). I need to display this header only in the list, but hide that plugin's header field in detail view.
How / where can I do that via page TS?
This is probably not even in the plugin, but in css_styled_content?
Something like this...
[globalVar = GP:tx_news_pi1|news > 0]
plugin.tx_news.stdheader >
[else]
But how?
A plugin is always using this prototype object:
tt_content.list
Therefore you could delete the header of this object like that
tt_content.list.10 >
But if you have other plugins on the same page, their headers would also be deleted. So that would be a bad idea.
I would suggest you use the header_layout field. By default it has an entry called "Hidden" that will hide the header of your plugin. If you don't have it, check the Page TypoScript configuration. You can add own items by using:
TCEFORM.tt_content.headerLayout.addItems.99 = My Header Layout
Then you can then define the rendering of your own layouts in
lib.stdheader.10
(it's a CASE object)