Description syntax of smarty because after some code my variable already overwrite - content-management-system

Can someone explain this code int Smarty file:
{hypnosOnepagecheckout nSeitenTyp=$nSeitenTyp return=onepagecheckout}
because I try to assign some variable that have name "Zahlungsarten" to smarty file but after that line code the variable alredy overwrite .
For note I develop some payment plugin to jtl shop cms.

This calls a smarty plugin named hypnosOnepagecheckout with the parameters nSeitenTyp and return and their according values after the equal sign.

Related

Get path of FAL media?

Using Fluid Template with tx_news, I need to get the URL of uploaded FAL video.
Currently I have this:
{newsItem.falMedia.0}
Which prints:
GeorgRinger\News\Domain\Model\FileReference:3
I want the output:
fileadmin/user_upload/MyVideo.mp4
newsItem.falMedia seems to be an ObjectStorage. With .0 you are pointing to the first object of it - not any function of it. In the API you can see its functions http://api.typo3.org/typo3cms/current/html/class_t_y_p_o3_1_1_c_m_s_1_1_core_1_1_resource_1_1_file_reference.html or you can debug it in Fluid by using {newsItem.falMedia.0}
Example: {newsItem.falMedia.0.publicUrl} should give you the public path to the file.
If you just need url of image than use following line
{object.image.originalResource.publicUrl}..
TYPO3: get path out of file reference in Extbase
Please refer above link.

Generate dynamic key in i18n AEM

I have requirement for having a dynamic key for getting value in i18n. I am using sightly. i would be having the initial part of the key but the last part i have to attach dynamically and then allow sightly to get the value for the same. Could you please help me on it.
I guess best practice would be to have a getter at some component-bean to avoid as much programming logic within the markup as possible. If you like/need to put the logic into the html anyway try something similar to this:
<p data-sly-test.keyPostfix="${isTrue ? 'true text' : 'false text'}"
data-sly-test.i18nKey="${['some.i18n.key', keyPostfix] # join='.'}"
data-sly-text="${i18nKey # i18n}">This text will be replaced by sly-text!</p>

Template could not be loaded in TYPO3 extension

Am using a new extension build in TYPO3 V4.5.0 and after it installed it in TYPO3 V6.2.x it shows the following error
The template files "/var/www/dev/typo3/typo3conf/ext/my_ext/Resources/Private/Layouts/Suche.html", "/var/www/dev/typo3/typo3conf/ext/my_ext/Resources/Private/Layouts/Suche" could not be loaded.
The layout i s present in the location. and path given also correct in backend..
How can i fix this?
Check so template filename has first letter uppercase.
The rule is that for action named fooBarAction() template file must be named FooBar.html

Add week in smarty tpl

Output: 2015-01-20 03:52:19
Need 01.20.2015 + 1 week = 01.27.2015
I curently have {$order[orders].invoice_date|date_format:"%d.%m.%Y"}
But how to add week + 1?
So, I need to add 1 week and then formating this.
But the date isn't in the timestap format.
Smarty version: 3.1.
I can use only smarty logic, not PHP.
How to achieve this?
You don't need a plugin to work this out. It can be solved with a combination of cat and date_format.
Since date_format is a wrapper to PHPs strftime(), you can use the conversion specifiers available in strftime() - and that is what I used tackle the issue at hand.
Try this:
{$order[orders].invoice_date|cat:' +1 week'|date_format:"%d.%m.%Y"}
I've used Smarty version 3.1.17 to recreate your problem. The solution is based on the assumption that the value in your variable $order[orders].invoice_date is a string 2015-01-20 03:52:19.
You can create a smarty plugin, something like this one to suit your needs. http://smarty.incutio.com/?page=AlternativeDateModifierPlugin
You shouldn't be doing this logic in smarty at all. This type of thing should be done in the php code - assign two date values to two separate smarty variables (one with the 1 week added), and use the appropriate one in the appropriate place in your template (applying the appropriate date_format as required).
edit: I know you've said you want to do this using smarty syntax - I'm just pointing out that trying to do this type of manipulation in smarty is not what the template language is designed for. If you only have access to the smarty .tpl files, you might try using the {php} tag to put your php logic in the .tpl file.

TYPO3 extension: how to find certain TS setting

I found in typo3 admin side(/typo3), you can have two ways to set up TS,
you can set up through template->root, I think TS here will affect the whole site.
you can set up through template->certain page, it will only affect this page.
So my question is:
If I want to find where(which page) has TS setting such as : code = LIST, how could I do?
Use Web > Template module it has tools, you can for an example use Template Analyzer for the search
Try querying the database in phpMyAdmin or similar. The following looks in Template Setup:
SELECT pid, config, constants
FROM sys_template
WHERE config LIKE '%code = LIST%'
Replace config with constants to look in Template Constants. pid is the page ID.
If it is not set in the TypoScript, it perhaps has been set in the plugin itself. Just check the plugin content element itself.
In the Template module, go to the page where the setting is in effect.
Use the TSOB (Typo Script Object Browser) to search for "list":
This must show you all TS for this page that contains "list".
If you don't see the setting you can run a cmd/ctrl-F Search over the entire results.
You would have to search for "[code] = LIST".
Which will lead you to the following entry:
Hovering over the label will produce the above tooltip. Copy the line number.
Now change to the Template Analyzer. Here, you can click through all cascading templates and search for the line number:
This is definitely the line that sets that value.
From the "Template hierarchy" tree you will easily find the template that contains the setting.