TYPO3 custom extension templates - templates

I am currently working on a new website with TYPO3 and now I am facing a big problem with template/cache.
Environment:
Extension "Portfolio" adds a new content element with Extbase/Fluid-Template. The template contains only the sentence "Create custom template" because I don´t want to provide a default template.
Extension "Layout A" contains the main template for the website, as well as the template for "Portfolio".
Cases:
When I am logged in as admin always the correct template is used.
When I am logged out and make "Clear all cache" in install tool the first page I load afterwards gets the correct template. The second/third/... page uses the first and wrong template.
Settings:
"config.no_cache = 0" is disabled
TYPO3 6.2.2
RealURL enabled
I added a TypoScript Text-Object with the template path to my fluid template and printed it in fronted. Always the path of the correct, second template.
Does anybody have an idea what´s the problem?
Thanks in advance!
Best regards
Boris

Install Tool Clearcache will clear the extbase cahe, so maybe the tempalte paths might be lost.
You should set the path to the templates explicitly via:
plugin.portfolio.view {
layoutRootPath = {$path}
partialRootPath = {$path}
templateRootPath = {$path}
}

Related

Flask-User /user/sign-in view, where is it?

This is prolly a stupid question but I am experimenting with Flask-User. I see the venv/.../flask_user/user_manager__settings.py file and see
USER_LOGIN_URL = '/user/sign-in' #:
I do not see a method for this though. Something is rendering a view for the sign-in page but I am not seeing the connection. What part am I missing?
Edit
What am I asking? I have copied the flask-user templates from site-packages into my test. I have slightly tweaked them. However, when I click the default Signin link I get an untweaked login template. I am wondering if something has a hardwired template path? I am just not finding that url->view->template linkage.
There are config options to change the templates, for example:
USER_LOGIN_TEMPLATE = 'your/path'`
Found here: https://flask-user.readthedocs.io/en/latest/configuring_settings.html

Which folder to put email templates in, when sending from admin?

I've inherited some code that doesn't work, where a button (with a custom function) exists in the admin page for particular dataobject, and triggers an email to be sent. The code is currently trying to populate the body of the email by using a template file, which is currently in the theme folder for the site.
However, the email body is blank, as the template is not being found. My understanding is that the admin section of the site doesn't look in the theme folder for templates. Where can I put the template (and the other templates it includes) where they can be found from code in the admin part of the site?
$email = new Email($sender_email, $recipient_email, "Your order has been shipped!");
$email->setTemplate("OrderShipped");
$email->populateTemplate(array("Order" => $order));
$email->send();
The error being output to the error log is this:
[17-Nov-2014 14:34:01] Warning at framework/view/SSViewer.php line 780: None
of these templates can be found in theme 'mytheme': OrderShipped.ss
(http://mytestsite.co.nz/admin/orders/MyOrder/EditForm/field/MyOrder)
As the theme is not set when in the backend of the CMS, templates should not be in the themes folder. You can try to move the file into mysite/templates/Email for the main email template. Any includes can be stored in mysite/templates/Includes.
as jfbarrois wrote, the theme is not set in CMS. So I used this small hack and it started to work:
Config::inst()->update('SSViewer', 'theme_enabled', true);
Config::inst()->update('SSViewer', 'theme', 'mysite');
// change 'mysite' with the name of your theme
and you can keep the template in "mysite/templates/Email".
Maybe there's also some other option how to do that, but I haven't found it yet.

How can I develop a list template for a dynamic list in Liferay with action buttons?

List template in dynamic data list in Liferay
I have already read this post and also another webapplicationdeveloper blogpost but not find any idea to get action button in customly applied template to dynamic data list.
I have also tried including that default record_action.jsp of dynamicdatalist portlet in vm template but its not working and also set the property below
journal.template.velocity.restricted.variables =
in portal-ext property but still I am not getting the action button in my custom template
I have already tried this :
#
set (
$categoriesService = $portal.getClass().forName("com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil").getMethod("getService", null).invoke(null, null))
My answer is: Yessss, it works. But I want use a jstl lib (e.g. <aui> or <ui>) as well. In my opinion the simpliest way to do it is include jsp file to themeServletContext. Put your file.jsp into your theme:
your-theme/docroot/path/to/your/jsp/file.jsp
and paste this piece of code into your vm (for example portal_normal.vm):
$theme.include($themeServletContext, "/path/to/your/jsp/file.jsp")
In this case it unable to find the $theme variable my page displaying the $theme as it is...:(
Please help:
Leave velocity, it's too poor to use taglib, and switch to freemaker language: more powerfull and full support of taglib.
Here there is an example to use freemaker for theme develment, but it's good starting point also to template in dynamic data list.
https://www.liferay.com/it/web/mika.koivisto/blog/-/blogs/using-freemarker-in-your-theme-templates
Look also freemaker guide: http://freemarker.org/docs/index.html

Tell TYPO3 extension to use different template using Typoscript

I'm trying to get an extension/plugin on a page to use a different template from the one its hardcoded with.
I made an html template stored in:
typo3conf/ext/myextension/pi1/new_extension_template.html
I made a typoscript template object in the root of my site (so it would definitely get picked up).
In it, I have defined the following simple Typoscript (names changed for demonstration)
plugin.tx_myextension_pi1 {
templateFile = typo3conf/ext/myextension/pi1/new_extension_template.html
}
However when I load the page containing the plugin, I get a "no typoscript template found" error on that black TYPO3 error page.
I have tried a bunch of alternative ways in case the syntax was wrong but the above worked for me when working with the tt_news plugin.
E.g I have tried these without success too:
templateFile.file = typo3conf/ext/myextension/pi1/new_extension_template.html
...
tempfile.template_file = typo3conf/ext/myextension/pi1/new_extension_template.html
Any ideas what I'm doing wrong?
Can html templates stored in typo3conf be called via typoscript stored outside the plugin?
I'm thinking perhaps html template files would have to be stored in fileadmin/plugin_templates/ for this to work.
You are mixing things: no typoscript template found means that on the page you inserted the plugin there is no TS template available.
Page with plugin isn't nested under the main page (which - as I assume - has main TS template and is displayed properly), so just drag it into the main page, or create new TS template on its level.

modx is only showing html code, not the template

I have installed ModX and Downloaded the "Basic" Template in the Extensionmanager! I chose the Basic Template at my first Page for the Resource! I cant find a Globalsetting to choose an Template? My problem is that if iam going to the site i only get the pure html code shown, no website! Why is this?
AFAIK there is no "Globalsetting" to choose a template. One of the nice things with MODX is that each resource can specify which template to use. So you can mix and match as required.
You could check if you have set the base href tag in head like this:
<base href="http://www.yoursite.com"/>
It will tell the site where to start looking for the other files that you have included in your markup.