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

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.

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?

Write typoscript in project files and not in backend

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

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.

Adding custom file extension to netbeans ide

I'm using NetBeans 7.2.1 for my developments with CodeIgniter/Bonfire.
In my controllers i'm loading my for the view needed JavaScripts via
Assets::add_js($this->load->view('admin/index_js', $data, true), 'inline');
to preparse some php variables in the JavaScript (like dynamic url's).
This forces me to save these JavaScript files witht he extension ".php" so that i can load it via
$this->load->view
All these JavaScript files are using the filename syntac
*_js.php
Since i load it via view and Assets with "inline" parameter i can't put the
<script>
</script>
tags in the script so NetBeans is not recognizing it as JavaScript and i have no syntax highlightning and no formatting options.
Any idea how i can get it that NetBeans can recognize it as JavaScript?
Thanks a lot.
Okay... got it...
One of my collegues made a change to the assets library to "erase" the script tags from assets::js inline included files:
http://forums.cibonfire.com/discussion/1134/assetsjs-inline_js-change-to-load-js-via-view#Item_1

add a new plugins path to Qtwebkit

I am trying to extend the search paths that qtwebkit uses to search for plugins. Basically I'm creating a plugin that is designed using the QTBrowserPlugin class and I am trying to make my browser which is programmeed using QTwebKit to search for the plugin in a folder specified by me as I don't want the plugin to be stored in the Mozilla Firefox plugins directory or the standard plugins directories.
Is this possible, and can I make my browser only look in the directory that I've specified, skipping all the standard directories. Since the browser will only be used to view locaL html pages.
There does not seem to be a public method in QtWebKit for doing this.
If you're willing to build QtWebKit from source, you can add a method to QWebPage that calls PluginDatabase::setPluginDirectories() and PluginDatabase::refresh().
I believe you can set the environment variable QTWEBKIT_PLUGIN_PATH for this purpose.