TYPO3 Plugin: ways to insert on a page - typo3

Is it possible to insert a frontend plugin to a page without having a template (and markers) included?
Normally I use:
10.marks {
CONTENT_LEFT < plugin.tx_xy_p1
}
But in a new project I dont want to have a template file where the markers (###CONTENT_LEFT###) are included. The plugin should appear as the only thing on that page.

If all you want is the plugin, simply create a sparkingly fresh root template with the standard page object of type PAGE, and insert plugin content there.
Create a new page with rootflag etc, and maybe the static files for your plugin, if needed. In the setup field enter your adaption of this:
page = PAGE
page.10 < plugin.tt_news
You might of course need to add more, depending on your needs, but this should be the principle (and it works, I tested just now). :-)

Related

TYPO3 : Adding plugin to page using the code

As a beginner with TYPO3 CMS in a new job, I had to make a new extension with differents plugins with a new table called "Products" and make the migration between the old products system and the newest one.
The goal of this was to adding automatically my plugin into the webpages using the code (no other solution, literally too much page to adding my plugin by hand).
I tried adding the reference of my plugin in the list_type field in my tt_content but unfortunately it doesn't work.
My question is: "Which fields I have to fill in in order to adding my plugin into my page?"
If you have been following common plugin registration your plugins will be in tt_content with CType: list and list_type: <extensionkey>_<pluginkey> (without any other underscores - for the linked example that would be exampleextension_list).
Some Background: TYPO3 (or rather TypoScript CONTENT, the base of all rendered content) then draws the rendering configuration from TypoScript setup in tt_content.list.20.<list_type>. In your case that will hold an entry point to render an Extbase action.
Required fields for your plugin in tt_content: pid, colPos, CType, list_type. If you used a Flexform for the plugin settings, also pi_flexform.
If you need something else, it is easiest to find out by adding your plugin via the backend and inspect the newly added DB record in tt_content afterwards.
Hints for debugging (I assume TYPO3 v9+):
Set TYPO3's application context to 'Development' by setting the environment variable TYPO3_CONTEXT=Development - this will show you the tt_content column names in the backend forms.
Set FE/debug = 1 (in LocalConfiguration.php or via InstallTool/Settings/Global Configuration) - this will show warnings in the frontend if your plugin configuration could not be found.

Typo3 create reference element for all subpages

I have a TYPO3 8.7.
I need an element (plugin) to be displayed for all subpages.
I found such solutions:
1) Create element reference But I do not know how to add it simply on all pages?
2) Add plugin on every pages But is it possible to copy exactly my plugin installed on the page ?
Both approaches are suboptimal, since you either had to create a reference content record on each page or your plugin would not be configured manually anymore.
My recommendation would be to put that particular plugin into a specific column of the root page and inherit the content of that column via the "slide" feature of the CONTENT cObject:
https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Content/Index.html#slide
We are using this feature i.e. for the whole footer section of https://coders.care including the twitter plugin and the random testimonial content.

Creating a new page template in Typo3

I'm using Typo3 for the first time and have been asked to update a site built on it.
Making changes to existing templates so far has been OK since they were mainly CSS changes or replacing images. Now though I need to create a couple of new page templates.
What's the easiest way to go about this? The existing site has a home.html and layout.hmlt in the fileadmin directory. Do I need to create a new html file there, if so how do I use this as a new template for some of my pages?
I'm coming from a mainly WordPress background in terms of CMS (I've nearly given in a recoded the site as a WordPress site since I think it would be quicker at this stage) but I'd really prefer to figure this out.
Any suggestions would be greatly appreciated as I'm pulling my hair out trying to read through the documentation and getting nowhere. The site is using Typo3 version 4.4.6
Thanks!
How you add a new template to your page depends on how templating is handled. Sadly TYPO3 has a poor templating out of the box, so there is most likely an extension that does the job on your site.
Probably one of these:
automaketemplate
templa_voila
flux & fluidpages
Check if one of these extension is installed and add a new page template according to the extensions manual or specify your question afterwards.
Edit:
If plain TYPO3 was used, you'll find something like
page = PAGE
page.10 = TEMPLATE
page.10 {
file = fileadmin/myTemplate.html
}
in your Typoscript. You can add tmplate files like the ones that are already there. To use a different template on a page, you have to replace the page.10.file with the template you want to use. This can be done with a new template record (crated in backend via the template module). But this is a rather anoying procedure to change the template, because you have to create each time you want to change the page template for a page and its children. That is why mostly extensions are used for this.
The out of the box situation gets better with newer TYPO3 versions but in 4.4.6 there are no Backend Layouts that could be uses for a template switch ot something like that.
In Addition to change the mere file you have to adjust the subparts or marker that are filled with the content. You'll find that configured in your TypoScript as well

TYPO3 - HTML RTE frontend rendering is not working

I have the latest version of TYPO3, and the data I entered in the RTE is not rendered properly in the frond end (in site).
So for example <p>asdf</p> will show as it is in frond end.
I googled it and tried with some RTE default configuration changes, but that did not work well.
Please try with some basic testing first.
Create a new site on root level (directly below the globe). Create one content element with all text and styles you want to test.
Create a new Typoscript template for this site and put the following in the setup section:
page = PAGE
page.10 < styles.content.get
Make sure to include CSS Styled content inside the static template section.
Now watch your page page in frontend. Does it work?
Otherwise try step 0. and create a new (admin) backend user first.
Most likely you have either a strange transformation rule inside your RTE config in backend (UserTS or PageTS) or you have some kind of htmlspecialchar definition for your frontend rendering.
Please post something of the following basic Typo3 configuration settings and/or tell us if you use something of that:
You Upgraded from an older Typo3 version? Than it could be, that some configuration is missing.
Root Template or Site Template inside Typo3 Backend you can create or edit one, when you click in the most left menu on "Template"
If you choose "Create Template for new site" button the most basic Typo3 Typoscript * is automatically created
# Default PAGE object:
page = PAGE
page.10 = TEXT
page.10.value = HELLO WORLD!
Do you have such an TS (= Typoscript) tested? TEST IT and tell us if it works!!!
Does this work for you?
(Typo3's own configuration language - both a blessing and a curse - can be so easy and so painful - most laughful description i ever read, you can found on hatetypo3.blogspot.de "spaghetti code festival")
Don't miss include "CSS styled content" (it's in the form "edit whole template -> Includes)
But if you don't have include this, normally no site content is displayed in the frontend.
Another way is to include basic TS configuration in one or mor separate files. To get the files working, you have to referce them by this snippet in a Site Template in the BE
<INCLUDE_TYPOSCRIPT: source="FILE: yourfile">
# BTW I saw that it is common to place the file in a dir like
/fileadmin/ts/yourtyposcriptfile.ts
So give us this info or ask for more, if i miss something.

Wordpress Cusutom Page, With PHP,js html and css

How can I implement a full html,php,js and css page into a wordpress page?
Example:
I have a app.php that has a text box, when You press enter it displays the text with a php echo. With the users profile picture from Facebook.
How Can I inset/implement that into a WordPress page?
HTML/PHP: The simplest way may just be to create an extra template in your theme. You can view WordPress template hierarchy here: Template Hierarchy
JS/CSS: If the JavaScript and CSS makes the most sense to be embedded (it usually does!), you can use hooks and actions in a simple plugin (or potentially your functions.php page) to include the JavaScript and CSS you need.
wp_enqueue_script
wp_enqueue_style
Note: I have not personally used functions.php (found in your theme files) to call these sorts of hooks, but I assume it would work just fine.
If you are using a theme that constantly receives updates, it is worth building a plugin to do the job. If not, it's easiest to just modify the theme.
There are two options as far as I know. First one is that you embed the code directly into your posts, and install the plugin called PHP execution. Second, try to create your own page template, and place your own code in the template. then you can create a page in the dashboard and select the template.