Typo3 extension configuration - typo3-8.x

I have installed typo3 extension "cookieman". The documentation says it comes with 2 static templates. Include the static TypoScript “Cookieman” in your root template or reference the necessary files in your site package. what is the location of a root template? and what is the syntax to include something?

first: be clear what Template means in this context.
there are multiple kinds of template in TYPO3.
There are HTML-templates which define the structure of parts of the output. That could be Fluid-templates or the older marker-based templates.
Then there are records which contain the typoscript configuration which also are called templates.
This typoscript-templates are meant. As the typoscript templates can be stored in each page of your page tree, which are concatenated, you have a root-template propably in the root-page of your website. (the added ts-template are called extension-templatesas they extend the basic configuration).
These records have a field for additional templates from TYPO3 extensions which are called static templates as they come from an extension and are never changed (never change any file from an extension inside the extension folders!!! you always can override the values).
Otherwise you can use explicit include statements in a typoscript configuration. The include statement was invented in TYPO3 4.6 and has changed it's syntax slightly until now. In the online-manual you can select your version to see syntax of your TYPO3 version.

Related

Why Fishpig is asking for write-permission on wp-includes/i10n.php?

I'm updating Fishpig Wordpress-Integration to version 4.5.1.5 (with addons ACF, CPT, CS, Root, Multisite) in a new ansible-deployment. Now I get the follwoing error in the Magento-Backend :
Permissions The following file must be writable: /path/to/magento/wp/wp-includes/l10n.php
Why at all should a magento-module have write-permissions on a wordpress-core-file?
We prefer strongly to have separate concerns, so that the wp-core-files can't be compromised by anything from magento-side.
The questions are:
for which task in Fishpig (or it's addons) this write permission will be used?
could the _validateL10nPermissions() be overwritten for not checking this file without loosing an important functionality in Fishpig?
Would be great to get some clarification about this point.
This file needs to be modified because both Magento and WordPress have a PHP function with the same name, specifically the translation function:
function __($args);
It is not possible to have multiple functions in PHP with the same name. The only way to include the WP code base into Magento and make it available is to stop either Magento or WordPress from defining this function. The module chooses to modify the WP file instead of the Magento file.
The modification it makes it a simple one. It simply wraps the function definition in WordPress with a call to function_exists. This checks whether the function has already been defined (ie. in Magento) and if it has, it doesn't define it again. If it hasn't been defined, it defines it.
if (!function_exists('__')) {
function __($args);
}
This allows WordPress to work on it's own and when included into the Magento code. Without this modification, it is not possible to use Magento and WordPress together.
Write permissions are only required if the file does not include the modification. If the file already includes the modification then write permissions are not required. If you don't want to give write permissions on your live server, have the file modification take place either on a dev/staging server or make the file modification yourself as part of your deployment process.

Silverstripe v4 MVC Directories?

I'm Wondering Why There is no "Models / Views / Controllers" Directories Inside SS4 Main Directory? It's Seems Like Everything Should Go Inside "mysite/code" .. How To Accomplish MVC Style?
MVC is more of a software-architectural pattern, not how you organize files. There are only a few assumptions the SilverStripe framework makes on how you should organize your code:
Model
With SilverStripe 4, the default code folder for every module is named src or code. In that folder you're free to organize your files as you see fit. Ideally you build your folder structure in a PSR-4 compliant way, so that your folder-names match with your namespaces.
Controllers
Same as with Model classes, you can put your controllers anywhere you want.
There's a default assumption for Page classes though. These expect that the matching controller has the same namespace as the page. So if your page is named: Company\Module\Pages\MyPage, the framework would look for Company\Module\Pages\MyPageController.
You're free to override that though, by implementing the getControllerName method on your Page and return the FQCN for the controller to use.
Views
Also known as "templates" should be in a templates folder. Each module (your mysite folder is also a module) can have a templates folder.
In addition to this, you can have themes. Themes usually bundle templates, css and other assets. In the themes folder you can have multiple theme folders, each one can have a templates folder.

How to point at the templates folder of a module in Drupal 7

How do you make Drupal read the templates you create or override in a module (when you create templates that get overriden in the theme folder, Drupal reads them automatically)?
When you implement hook_theme() or hook_theme_registry_alter() (in the case you are overriding a template file defined from another module), you use the "path" property to tell Drupal where the template file is.
This is particularly important with hook_theme_registry_alter(), since you are overriding the template file used by another module, and you want Drupal looks for the template file in your module's directory. With hook_theme(), it is important to use the "path" property when the template file is not in the directory containing the module (or the theme), but in another directory, for example in a sub-directory of the directory containing the module/theme.

Struts2 With Styling outside the war/ear

I have a problem with Struts2, the problem is, the client want the styling of the web apps is dynamic, for example is, i can put the template (.html / .ftl) on /apps/template/path where all the logic on war, can i do that?
i've been searching all over google and that style of code is belong to freemarker. but if using freemarker, i have to code using servlet (i dont wanna do that).
Can you give me the hint/solution, or it really cant be in Struts2?
if using freemarker, i have to code using servlet
No, FreeMarker doesn't need Servlets instead of Actions.
FreeMarker is fully integrated in Struts2, it just needs the library in your libs directory and some little configuration in struts.xml and web.xml.
According to Struts2 documentation,
Template Loading
The framework looks for FreeMarker templates in two locations (in this
order):
Web application
Class path
This ordering makes it ideal for providing templates inside a
fully-built jar, but allowing for overrides of those templates to be
defined in your web application. In fact, this is how you can override
the default UI tags and Form Tags included with the framework.
In addition, you can specify a location (directory on your file
system) through the templatePath or TemplatePath context variable (in
the {{web.xml)}. If a variable is specified, the content of the
directory it points to will be searched first. This variable is
currently NOT relative to the root of your application.
So, if you want to use .FTL files (FreeMarker Templates) INSTEAD of JSP files, you can put them outside the ear, in the file system.
Like this (web.xml):
<!-- FreemarkerServlet settings: -->
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/apps/template/path</param-value>
</init-param>

Umbraco - Get Directory of Config Files

I'm working with Umbraco 4.7.1 and I've created some extensions that hook into Document.AfterPublish and Document.AfterUnPublish. I need to find the directory of the config files from here, but need to be independent of server installation (i.e. a literal won't work). Is there any way of finding this at that point in time?
I think what you are looking for is the umbraco.IO.SystemDirectories class, specifically the Config property.
This will return "~/config" by default, but can be overridden by adding a umbracoConfigDirectory key to the appSettings section of the web.config file and specifying a different path there.

Resources