Looking at the Magento 2 docs, you can override a base/core layout.xml file - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html
Is it possible to do so within a module rather than theme?
Alternatively, is it possible to bundle a theme within a module and extend that (and multiple other themes from multiple other modules) from the main website theme?
Related
I have Liferay 7.2
I want to customize the html of the layout of the widget Documents AND Media
I tried to create a hook to document and media but it seems that is not the right way.
How can i do that?
First, the fact that you're talking about a hook tells me that you're coming from Liferay 6 or earlier. Forget the old module types ("war-style modules"), embrace the new "jar-style modules" or "OSGi modules", which leverage the OSGi methods and mechanisms in the foundation. The new module type that comes closest to the functionality of hooks would be a "module fragment".
Alternatively, if you want to create one module that overrides the JSPs of more than one other module (or overrides JSPs as a side effect to its main purpose), you may want to look into "JSP Bags".
Still, both methods are discouraged and should be taken as a last resort, according to Liferay's "Introduction to Customizing JSPs".
The preferred method would be to use Dynamic Includes (albeit they only work if the target portlet has been written to include inclusion points) or Portlet Filters (which basically allow you to programmatically edit the request to and response from the standard Portlet classes and JSPs).
Still, if you're aiming to replace most of the JSPs of the standard document and media widget (keep in mind: Widgets are still Portlets, they just have been renamed in the frontend), a module fragment still seems to the best way forward.
To identify the correct module, here are the necessary steps. I'll show it using the DLAdmin portlet from the control panel as an example:
Identify the portlet you want to edit: Look into the HTML using the DOM inspector of your browser. Look for section tags with IDs like <section class="portlet" id="portlet_com_liferay_document_library_web_portlet_DLAdminPortlet"> around the area of interest.
Now translate that ID into a package path with portlet class: com.liferay.document.library.web.portlet.DLAdminPortlet. Search for that class in the Liferay github repository. (Go there, press T, enter the class name, find its Java class source file. In case of multiple hits, you need to check the package path, too.)
Once you opened the source file, go back up in the file tree to the parent folder of the src folder. There's a bnd.bnd file. Take a look into it, it will tell you the Bundle-SymbolicName.
Use the Liferay IDE or Blade CLI (depending on your development environment) to create a module fragment for the module identified by the Bundle-SymbolicName.
I am currently developing my own TYPO3 extension (in v 9.5.11) and I want to know where I have to reference the Html file that is supposed to open when you click on Admin Tools-->MyExtension in the TYPO3 sidebar.
This completely depends on how you integrated your extension; there are at least two (vanilla, Extbase) ways to make such modules. Where your template file (which is Fluid, not pure HTML) exists depends on the integration and your TypoScript configuration that defines template paths, but by default it would be in your extension, in the sub path Resources/Private/Templates/$controllerName where $controlerName is the name of the controller that renders your plugin.
Note that template paths for frontend and backend are configured separately.
If you use the vanilla way of making backend modules you most likely need to define this template manually, by setting it in the view, in which case it can be placed anywhere you like (but should of course be inside your extension).
Have a look at system extension extensionmanager, where the backend module has some registered controller classes, and methods in ext_tables.php. fx class ListController, with indexAction, unresolvedDependenciesAction, terAction, ... and more methods:
'List' => 'index,unresolvedDependencies,ter,showAllVersions,distributions',
ListController class like all other controller classes uses FLUID views, which is looking for HTML templates inside Resources/Private/Templates/<CONTROLLERNAME>/...
For ListController->indexAction it would be Resources/Private/Templates/List/Index.html where you can use TYPO3 FLUID functionality.
See also https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/BackendModules/TemplateClass/Index.html
Well, It is always recommended to write your question clearly and bit more detail so people can understand quickly.
Anyway as I understand the question, you're talking about view resource file. If you have created your extension with Extension builder, your action file will automatically be generated in the Resource folder.
BE module directory will be Resources/Private/Backend See the example here.
In the TypoScript, you will get the source path this will something look like this.
To check the backend default action, you can see the backend module configuration here. From here you will get better idea which action will be call by default (Probably List action)
In this directory, you will have all the HTML you need. Hope this will help you!
Imagine a multi-site TYPO3 installation. One of those sites uses an Extension (loads the extension's TypoScript) that modifies the config.tx_extbase.persistence.classes config for GeorgRinger\News\Domain\Model\News. Other sites also use News, but without including that Extension doing the modification.
The problem that you will run into is that the DataMaps are cached globally - so after clearing the cache it depends which site will be called first and its extbase persistence configuration will be cached, possibly breaking the functionality of the other sites.
To get around this problem I started to move DataMapper related TypoScript into a separate TypoScript file ExtbasePersistence.typoscript and load it globally in ext_localconf.php:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('myext', 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:myext/Configuration/TypoScript/ExtbasePersistence.typoscript">');
My question is: Why is this not best practise and done in every extension? Or what am I doing wrong that I seem to be the only one running into that problem?
Edit: From my point of view this would mean that also core extensions (such as extbase) MUST load their DataMapper related TypoScript globally.
Extbase does load this globally via https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/extbase/ext_typoscript_setup.typoscript
This file is auto loaded by TYPO3 on a global scope, this is also best practice, as far as I know.
Each Extension can add this file, see https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/FilesAndLocations/Index.html#reserved-file-names
Where do I edit default backend layouts that come with typo3 7.2 official introduction package? there is a table in the db that holds backend layouts but only those that I created, not the default ones. But where do I find the colPos layout for the default templates that already come with the installation? I only want to make slight modification in the html template and I'd like to make the changes editable from the backend.
Backend layouts are defined via PageTS below mod.web_layout.BackendLayouts.<key>. This is not a standard functionality, but a possibility provided by one of the integrated extensions.
The mapping of the backend layout ids to the template files is done in the actual TypoScript template at the path page.10.file.stdWrap.cObject.<key>.value.
For backend layouts created via the database, the key is the numeric id of the backend layout record.
I have a TYPO3 4.7 environment which holds 3 websites.
All theses website use TemplaVoilà template engine.
We are now redesigning one of these site and I wonder if I can use Fluid and Backend Layout instead of TemplaVoilà.
It seems that I have to desactivate TemplaVoilà in the extension manager to be able to use be layout.
Dislaimer: I'm not using TemplaVoilà myself.
The TCA Overrides of EXT:templavoila replace the backend layout fields with the respecting fields of TemplaVoilà, see here.
By reading this code, it should be possible to have both the TemplaVoilà fields and the Backend Layout fields if
"Enable data structure selection" is inactive and
"Enable the classic Page module" is active
in the extension configuration in the Extension Manager.