PyroCMS - Add WYSIWYG editor in frontend - wysiwyg

i need to show a simple editor in the frontend of my website.
I tried to append the wysiwyg editor in my Public_Controller in this way:
function ask(){
$this->template
->title('ask your question')
->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))
->build('user/ask');
}
but when i tri to see my frontend page i get this error:
An Error Was Encountered
Unable to locate the file: fragments/wysiwyg.php
How can i fix it?

I solved in this way. In the controller $this->template->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE)); while in the view just use wysiwyg-advanced

Related

TYPO3: Where is "sitetitle" set?

Where is this "sitetitle" set:
return $GLOBALS['TSFE']->tmpl->sitetitle;
I found this line of code inside a ViewHelper of WapplerSystems\WsT3bootstrap\ViewHelpers\Site
I found it by my self. Go to TYPO3 Backend / Web / Template. Just open the template setup and you will find the field Website-Title. This is the $GLOBALS['TSFE']->tmpl->sitetitle. Maybe there is a parent template who sets the sitetitle!

TYPO3 11 Sitepackage Tutorial expected template file Standard/1.html

TL;DR:
The Backend Layouts of the site package tutorial (Default/Standard and Two Columns) do not show up for new pages in Appearance -> Backend Layout. The error message in this thread (1.html) is an artefact of prior Backend Layouts which came from the original old site setup.
Solution:
To make the Backend Layouts of the site package tutorial show up there, I had to edit the root page of the site: Resources -> Include static Page TSconfig (from extensions) and add site-package from the Available Items list.
This can also be achieved without "Resources -> Include static Page TSconfig (from extensions)" but via file ext_localconf.php in the root of the site package extension (gpcf_theme):
<?php
defined('TYPO3_MODE') || die();
$boot = function (string $_EXTKEY): void {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:'.$_EXTKEY.'/Configuration/TsConfig/Page/Page.tsconfig">
');
};
$boot('gpcf_theme');
unset($boot);
Original Question:
I'm still trying to bring an existing (older) web page into Typo3 11 following the TYPO3 Sitepackage Tutorial.
Currently I get an
"Oops, an error occurred! Code: 202111161210589c32f8c0"
and can't get rid of it whatever I do.
The corresponding entry in the log files is (line breaks added by me):
../../var/log/typo3_61306f633c.log:Tue, 16 Nov 2021 12:10:58 +0000 [ALERT] request="30cc4e082c853"
component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler":
Oops, an error occurred! Code: 202111161210589c32f8c0- InvalidTemplateResourceException:
Tried resolving a template file for controller action "Standard->1" in format ".html",
but none of the paths contained the expected template file (Standard/1.html).
The following paths were checked:
/var/www/html/typo3_11/public/typo3conf/ext/gpcf_theme/Resources/Private/Templates/Page/,
in file /var/www/html/typo3_11/vendor/typo3fluid/fluid/src/View/TemplatePaths.php
I can't find the reason of this error, because I have no idea, where the needed template Standard/1.html is requested from.
Is this some kind of hard coded default if nothing else is found?
If this is the case, the real problem is, that my customizations to the Sitepackage Tutorial source code seems to be wrong, but it never produced any different error despite the above one, which isn't really helpful. Ok, this is speculation, because I don't know.
As you can see, the site package was renamed to gpcf_theme, it's available in the backend and applied as root template to the site. No other template is active (AFAIK). A simple newly created test page creates above error.
If I uncomment in Configuration/TypoScript/Setup/Page.typoscript the lines so that:
page = PAGE
page {
typeNum = 0
10 = TEXT
10.value = Hello World!
}
same error, no hello world.
Any idea how to locate the reason for my misery?
Maybe the fix is really simple. Try to go into the backend:
Edit the homepage
To to the "Appearance" tab
Set the Backend Layout for this and subpages
Save your change
There is a good chance that it is working now.
Whats going on?
You can cast this query on your database:
SELECT
uid, pid, title, backend_layout, backend_layout_next_level
FROM
pages;
Here you get a list of pages, some with backend_layout and backend_layout_next_level filled. Most likely your home pages has some values in this fields?
The value of this field is generated by the TSConfig for backend layouts you set in:
https://docs.typo3.org/m/typo3/tutorial-sitepackage/11.5/en-us/ContentMapping/Index.html#dynamic-content-rendering-in-typoscript
This column is then read and processed in your TypoScript:
https://docs.typo3.org/m/typo3/tutorial-sitepackage/11.5/en-us/TypoScriptConfiguration/Index.html#part-1-fluid-template-section
It is explained below the code snippet.
If the 4 steps from the beginning of my answer did not solve your problem, then this are the places to look.
In TSConfig is the definition of the backend layouts, columns, labels and what is written in the pages.backend_layout db-field
DB columns if the value makes sense pagets__<yourTemplateName>
The TypoScript that reads this db-field cuts of the pagets__ takes the rest, adds .html and searches in the paths defined in the TypoScript below.
check if the Folder and Filename of your Template file are correct.
the error message states that the file 1.html is expected in the folder /var/www/html/typo3_11/public/typo3conf/ext/gpcf_theme/Resources/Private/Templates/Page/
as you noted that you have renamed the site package you may have missed some occurrences of the original package name and so some configuration is missing or pointing to nirvana.

Form can't be saved in form editor after moving form definition into extension

After moving a form defintion to my own extension I cannot save the form definition.
I get this error message
The form could not be saved: The file
"EXT:myext/Resources/Private/Forms/bewerbung.form.yaml" could not be saved: >Undefined index: yamlSettingsOverrides
Here is my custom form setup
TYPO3:
CMS:
Form:
persistenceManager:
allowedExtensionPaths:
10: EXT:myext/Resources/Private/Forms/
allowSaveToExtensionPaths: true
allowDeleteFromExtensionPaths: true
renderingOptions:
translation:
translationFile:
# Default translation file for the frontend:
10: 'EXT:form/Resources/Private/Language/locallang.xlf'
Initially i got complaining about Undefined Index: _LOCAL_LANG, so I added the default translation file in my custom form yaml definition, and it disappeared, it seems it is not "inherited" from the BaseConfiguration. Am I missing another piece of yaml?
Could someone please give a hint, what's going wrong here?
After a composer update with all dependecies this error disappeared. Form Extension wasn't updated, so I think there was a buggy dependency.

TinyMCE template plugin insert last in editor

I´m using TinyMCE v4.7.9
When working with templates (https://www.tinymce.com/docs/plugins/template/)
I would like to insert the templates last in content editor, not where i stand, is there some hack to do that? Can i add a button "insert after" on dialog?
Now i'm stuck in some other P tag and my templates are DIVs.
Regards
After some trial and error and no way to find an answer to this, i found a work around.
I start the templates with <div data-insertafter
in setup on event "BeforeSetContent":
editor.on('BeforeSetContent', function (e) {
if (e.content.indexOf("<div data-insertafter") === 0) { //okej, insert after
editor.setContent(editor.getContent() + '<div class="row"></div>');//add an element to in the end
editor.selection.select(editor.getBody(), true);//select al
editor.selection.collapse(false);//set focus on that last div by inverting selection
e.content = e.content.replace("data-insertafter", "");//remove
}
});
You can certainly modify the template plugin to do that...each plugin ships in a minified and non-minified version so you can just modify the non-minified version to address this need.

.NET MVC2 - My area url does not register?

I have a new MVC-2 project where I added the area 'member'. I created a controller named: 'profile'.
This works: http://localhost:1234/Profile (loads up the index() function)
This however doesn't: http://localhost:1234/Member/Profile (i get a 404 error)
Am I missing something here?
There's no reason for this not working. From the default project template:
Right click on the project Add -> Area : Member
In ~/Areas/Member/Controllers add ProfileController containing a default Index action
In ~/Areas/Member/Views/Profile add Index.aspx
Run the application and navigate to /member/profile => it shows the newly added page
Can you check your Global.asax.cs file, see whether it has the following code in Application_Start
AreaRegistration.RegisterAllAreas();
If http://localhost:1234/Profile works, you might need to check the namespace of your ProfileController. It should be:
namespace YourProjectName.Areas.Member