Write typoscript in project files and not in backend - typo3

Okay the title may be confusing and thats because im a beginner in typo3.
So i set up a empty typo3 project via composer.
Now i want to write my typoscript "code" in my project files and not directley in the backend.
I added a template to a page and in the setup i started to define some page objects.
My problem is:
How do i tell typo3 to use the code that i write in my files rather then the code that is in the backend.
Also where should i put my typoscrip files.
I have them like this.
Also im a bit confused on why my ext directory is empty (besides what i added)
So i would like to move this code
# Default PAGE object:
page = PAGE
page {
bodyTag = <body>
meta.AUTHOR = My Name
meta.DESCRIPTION = My Website
}
To my Project file, and not do any editing in the backend.
Thank you this is my first time posting :)

I see that you've already created an extension EXT:website to store your TypoScript, Fluid templates, etc. You should proceed as follows:
1) create in your extension a php file:
website/Configuration/TCA/Overrides/sys_template.php
<?php
defined('TYPO3_MODE') || die();
call_user_func(function()
{
/**
* Default Static TypoScript for website
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'website',
'Configuration/TypoScript',
'My Provider extension for pages and content'
);
});
2) create two files:
website/Configuration/constants.typoscript
website/Configuration/setup.typoscript
3) You will be able then to add the these files using the "Include static (from extensions)" area of your TypoScript template.
Of course inside these files you can include other files or even folders, see the documentation here

First of all, your project extension (let it call sitepackage) is missing some files. At least an ExtensionManager configuration file ext_emconf.php in the root of your extension 'typo3conf/ext/website' and for composer based TYPO3 installation also a Composer configuration composer.json. See documentation here https://docs.typo3.org/typo3cms/SitePackageTutorial/ExtensionConfiguration/Index.html#directory-and-file-structure
To get started with your own sitepackagae extension have a look at
https://sitepackagebuilder.com/ which helps to kickstart. It will create folder and files, which you may not need, but gives you an impression, which is best practice for file and folders inside your TYPO3 extension.
In your Installation you need to create a root template at your root page. See documentation here https://docs.typo3.org/typo3cms/TemplatingTutorial/7.6/Tasks/WorkingTypoScript/TypoScriptTemplate/Index.html#create-a-new-typoscript-template
Your sitepackage extension should includes TypoScript files under Configuration/TypoScript/, which you can include manually in root TypoScript template at your root page.
for constants
<INCLUDE_TYPOSCRIPT:source="FILE:EXT:website/Configuration/TypoScript/constants.typoscript">
and setup
<INCLUDE_TYPOSCRIPT:source="FILE:EXT:website/Configuration/TypoScript/setup.typoscript">
There are also other different ways to initial load TypoScript. See for example documentation here: https://docs.typo3.org/typo3cms/SitePackageTutorial/ExtensionConfiguration/Index.html
A description on how to load TypoScript without any root template in backend published here https://docs.typo3.org/typo3cms/Snippets/2017/Index.html#root-typoscript-without-database

Related

direct routing to TYPO3 extension files

I am a maintainer of the TYPO3 extension QFQ.
Our extension accesses many of its files directly by links relative to index.php of TYPO3. For example it requests the following API file via JavaScript in the frontend:
/typo3conf/ext/qfq/Classes/Api/file.php
Since the upgrade to spoken URLs with TYPO3 v9 these relative paths stopped working. For example the above relative path would result in the following url when clicked on in the browser:
example.com/en/.../typo3conf/ext/qfq/Classes/Api/file.php
instead of:
example.com/typo3conf/ext/qfq/Classes/Api/file.php
We have seen that one can add static routes to single files in the TYPO3 backend (Sites > Edit > Static Routes > Create new) but this does not seem to allow us to set the whole extension directory /typo3conf/ext/qfq as a static route. Since many files are accessed this way, it is way too tedious to set a static route for every single fie on every installation of TYPO3 which uses our extension.
Our own "dirty" solution to this problem would be to add a new rewrite rule to the .htaccess which rewrites any url containing typo3conf/ext/qfq. It would remove any path before typo3conf.
My question is: Is there a better way to solve this problem? How do other extensions create links directly pointing to the files inside the extension directory? Are we missing something obvious?

How to access pages without adding .HTML extention to the urls in AEM 6.3

I'm working in an AEM project and part of development we are accessing the content using http://localhost:4502/editor.html/content/xyz/en/app.html.
While navigating to another page it is redirecting me to http://localhost:4502/editor.html/content/xyz/en/inko-app (observe carefully the link is without .html extension) and in order to see the new webpage I had to add .html extension manually.
Is there anyway I can automate this only for development environment?
Versions used:
AEM: 6.3
build version :20170420
I have gone through Adding .html extension to page selected but it is not quite useful
Can you check if in your sightly or java where you are declaring the page path, have you added .html as extension or not?.
For exmaple :
In your sightly if you are getting page path as "${currentPage.path}", the value will be without html, you need to explicitly add .html to
"${currentPage.path}.html" like this.

TYPO3 news extension - show the whole article

I'm using the news extension for TYPO3. I have a page named "News" where I want to show ALL complete news records that exist. But the article is cut with a button "Read on" which leads you to the detail page.
What do I need to do that it shows the whole article on the news page of each article that exists?
TYPO3 version: 7.6.14
Set TypoScript constant plugin.tx_news.view.partialRootPath to a path of your choice (preferrably to an extension holding your concrete site‘s configuration and assets), create a subfolder named 'List' in this path and copy file EXT:news/Resources/Private/List/Item.html over to the newly created folder.
Then adopt this file to your needs. Apparently, you‘d have to change stuff around line 52 to use bodytext only and remove the f:format.crop…
It‘s worth understanding how fallback in template root paths works in news and in TYPO3 in general - I suggest you read up a bit about it

TYPO3 RTE Stylesheet broken link?

I am using this typoscript in my Page TS Config to add a stylesheet to the RTE:
RTE.default.ignoreMainStyleOverride = 1
RTE.default.contentCSS = fileadmin/templates/css/rte_formats.css
I have used this several times perfectly, however I am working on a new server running TYPO3 7.6.11 and the stylesheet does not link.
If I inspect the RTE the css file is linked there, but the link is broken.
I don't know if it is related but in the filelist area if I open the info window for the css file and click the 'Show' button I get a 404 (the same happens for every file, even though they are working fine on the front end).
Strange, file show info also adds the /typo3/ before the fileadmin part but the files are listed in the filelist? What result do you get when you use RTE.default.contentCSS = fileadmin/templates/css/rte_formats.css
Frontend and Backend need to be completely accessible. A configuration where server.com has no access to fileadminand mysite.com with no access to typo3 is not supported. Both folders hold viable resources for Frontend and Backend.

How to create custom template of Typo3 bootstrap_package

I am quite new in typo3. I read somewhere
You should never edit the original templates of an extension as those changes will vanish if you upgrade the extension
How to create my own custom template based on bootstrap_package extension? I would like to override some files in parital/layout. It would be great if someone can post like/tutorial.
A folder structure and a simple custom typoscript that implement bootstrap_package for my custom temple would be great help.
The bootstrap package developers already added something for this. It is possible to set different locations, where templates are stored. It also uses a fallback solution, that means if a template is not found, it will fetch the original one from the extension.
Create a directory in the fileadmin directory, for example fileadmin/templates/BootstrapPackage. Inside this directory, create the directories "Templates", "Layouts" and "Partials".
In TYPO3 backend, go to the constant editor of the root page and select everything like the screenshot says:
Set the fields "Layout/Partial/Template Root Path" to your new created directorys (fileadmin/templates/BoostrapPackage/Layouts|Partials|Templates). Save and clear the cache.
Now you can create new templates. If you place an exacly named file like it is named in bootstrap_package/Resources/Private/(Layouts/Partials/Templates)/Page/ , TYPO3 will use the new template instead.