Use Powermail in Typo3 6.2.4 - forms

I'm using typo3 6.2.4 and powermail 2.0.16
I need to create a form who send a mail to me.
I created the form with the page and the fields. One is the name and one is the mail to test.
After, I created the content element with the plugin powermail and now, I need to display the form in the frontend. I have active the static "Main Template" and "Add basic CSS". I try this code but it's not working.
page = PAGE
page.10 = CONTENT
page.10.table = tt_content
page.10.select {
where = colPos = 0
orderBy = sorting
}
page.10.renderObj = COA
page.10.renderObj {
10 = TEXT
10.field = header
10.wrap = <div class="header">|</div>
20 = TEXT
20.field = bodytext
20.wrap = <div class="bodytext">|</div>
}
Can you help me?

The answer is here : Nothing appears in Typo3 with powermail (Frontend)
It seems that you are missing the proper typoscript to actually show the form on the page. The specified typoscript snippet is not enough to show the content elements on the page.
Inside your typoscript template include the css_styled_content static template and change the snippet to this:
# Default PAGE object:
page = PAGE
page.10 < styles.content.get
That should ensure proper showing on the frontend. This is basic as it is, if you want it to be better looking, or different templating you should take a look at templating with TYPO3 first.

Just thinking with you here, did you add this as a template in the typoscript template configuration? Like

Related

typo3 add content element to all pages that are direct child of a certain page using typoscript

I have defined a menu content element using typoscript:
lib.share = COA
lib.share {
wrap = <div class="shareLinkBlock">|</div>
1 = TEXT
1.data = page : title
...
I would like to add this menu to colPos 2 of every page, that is direct child of a certain page.
Is there any way to achieve that?
Thanks a lot!
A solution depends on the current realization of the page.
If you use only typoscript you can replace the colPos2 rendering with a COA where your typoscript is part one and the old rendering is a second part.
Using conditions can restrict the appearance to selected page trees.
In similar ways you can realize it with FLUID.
You can insert a fluid variable, filled with your typoscript in every page.
The restriction to special page trees can be realized with conditions in typoscript or in FLUID. Also you can use different page-layouts for pages with and without this menu.
another solution would be an additional backend column which gets inherited and where you fill in your menu for those pages where the menu starts being visible. (conditions like above)
EDIT:
if you want to enhance a given FLUID variable, defined in typoscript you can word with a COA:
:
10 = FLUIDTEMPLATE
10 {
:
variables {
enhancedColumn = COA
enhancedColumn {
10 = ..old definition ...
}
}
}
:
// make sure you use the correct conditions:
[PIDinRootline = 10]
...10.variables.20 < lib.footer
[global]

Reading data out of a flexform in typoscript

I try to read a flexform data out in typoscript. I tried it with several approaches, but none of them works correctly:
ajax.30 = TEXT
ajax.30.value = {$plugin.parser.settings.maxNumber}
ajax.40 < {$plugin.parser.settings.maxNumber}
ajax.50 < {$plugin.parser.settings.maxNumber}
ajax.60 = TEXT
ajax.60.data = {$field:flexform_varNum}
ajax.70 = TEXT
ajax.70.data = flexform : pi_flexform:settings.varNum
Can anyone give me a hint for the right syntax?
I'm using Typo3 9.5.13.
It is not possible to read out FlexForm data without an actual content element.
The CONTENT or COA objects would provide that. See for example Get FlexForm configuration in TypoScript
The feature was added in TYPO3 8.4 https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.4/Feature-17309-AccessFlexformValueViaTS.html

Display tt_address records when inserted via "insert record" in TYPO3 8.7

I'm looking for a way to display tt_address elements that were inserted with the "insert record" content element in TYPO3 8.7 LTS. I'm aware of a way with css_styled_content but i can't figure out how to do it with fluid_styled_content. Somebody on Slack pointed me to the "RECORDS" TS-Object and maybe the DatabaseQueryProcessor. Sadly, i can't find good tutorials or documentations for my usecase. Any help would be greatly appreciated.
There are two approaches
Custom Content Element for tt_address
That's the right way.
You can check how TYPO3 itself does it within the "shortcut" content element, which is "Insert Records" from the editor point of view.
The hints are totally valid. Use FLUIDTEMPLATE to define the template to render and add the DatabaseQueryProcessor as documented here: https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing
The processor can be found in the source code: https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/frontend/Classes/DataProcessing/DatabaseQueryProcessor.php#L22 with an example configuration inside the PHPDoc, which already uses tt_address.
Here a complete TypoScript example for the content element:
tt_content.custom_content =< lib.contentElement
tt_content.custom_content {
templateName = TtAddressRecords
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = tt_address
pidInList = 123
as = addresses
}
}
}
Using existing shortcut Content Element
If you are using the native shortcut content element already, this should work out of the box, with some configurations. It will resolve the selected records.
First of all you have to allow rendering of tt_address records through this element. Therefore add the following to the TypoScript Constants:
styles {
content {
shortcut {
tables := addToList(tt_address)
}
}
}
This will add tt_address to the existing tt_content table.
Next you need the rendering definition for tt_address records. This is done in TypoScript Setup. E.g. add the following TypoScript to the setup and adjust paths to your need:
tt_address < lib.contentElement
tt_address {
templateName = TtAddress
templateRootPaths {
10 = EXT:cdx_site/Resources/Private/Templates/Plugins/
}
}
The above example will use the Fluid Templates cdx_site/Resources/Private/Templates/Plugins/TtAddress.html to render each single tt_address record.
There should be no need to adjust the Shortcut.html template, as it will just display the rendered records.

Typo3 rendering multible pages onto one using sr_include_pages extention

I'm a total newbie in typo3 and I'm creating this website for a client of mine.
What I am trying to achieve is to render multible pages onto one page. So i did a little research and stubled upon the sr_include_pages extention. According to the description the extention fits my needs perfectly, but for the life of me I can't get it to work.
This is my page-setup so far:
six pages
the first one has two records in it. one is plain text. the other is
the sr_include_pages extention (both at colPos 0)
the other five pages contain a plain text record (for the time being)
each all at colPos 0
on the first page i added some simple typoscript as follows:
plugin.tx_srincludepages_pi1
page = PAGE
page.typeNum = 0
page.10 = CONTENT
page.10.table = tt_content
page.10.select{
where = colPos = 0
}
page.10.renderObj = COA
page.10.renderObj{
10 = TEXT
10.field = header
10.wrap = <h1>|</h1>
20 = TEXT
20.field = bodytext
30 < plugin.tx_srincludepages_pi1
}
when i switch to the frontend it renders everthing (even the header i added in the plugin record) but the content from the other five pages.
If you guys know a simpler way of solving this problem im open for everything
If this is some noob question im posting here i apologize. But I realy tried to do my homework before posting.
Thanks!
spiked_mp
if you want to hardcode the page ids, you should
be fine with (having incuded css_styled_content)
page.10 < styles.content.get
page.10.select.pidInList = 1,2,4
Not very flexible, though.
Here's a thread on this subject
http://lists.typo3.org/pipermail/typo3-english/2011-August/076460.html

How can I insert the current page title automatically into a TYPO3 template?

actually the title is the whole question.
I just want to modify the template so that the current page title is automatically shown (i'm working with html templates so I just need the bit of typoscript to get the page title out of the database)
I hope that's possible
It is. It's pretty simple to do. I'll assume you're using TemplaVoilà, because if you're not, you should be :-D
Start off by putting some HTML in your template with a dummy page title. Give it an ID attribute so it's easy to map. Like:
<h1 id="page-title">Page Title Here</h1>
Next, go into TemplaVoilà and map that <h1> element to the content type "TypoScript Object Path". When it prompts you for the object path, you can put in anything you want -- convention is that dynamic content is added in the "lib" namespace, so let's call it lib.pagetitle. When it asks you if you want to map this to "INNER" or "OUTER", choose "INNER" -- that will mean you're just mapping the space BETWEEN the <h1>...</h1> tags. ("OUTER" means you're replacing the whole element, including the tags, which we don't want here because we want this to stay an H1.) Save your template mapping.
Now go into your site's TypoScript template. Here you're going to insert the logic that fills in that space we just mapped with actual content. To insert the page title is a matter of a couple of lines of TypoScript:
lib.pagetitle = TEXT
lib.pagetitle.data = page : title
What this says is "take the space in the template that I mapped to lib.pagetitle. Create a content object in that space of type TEXT. Then fill that content object with the title of the page."
Save your TypoScript template. Now you're done!
This probably sounds complicated at first glance, and it is, but the nice thing about this system is that it's amazingly flexible. Inserting text dynamically is just the beginning. The TypoScript Reference (a.k.a. the "TSRef") has all the details -- look up "getText" to get a flavor, that's the function that makes the "page : title" call in your TypoScript template drop in the page title.
TSRef is your friend. I keep a printed copy of it at my desk -- if you want to make TYPO3 sing, it is your songbook.
I prefer the vhs solution:
{v:page.info(field:'title')}
https://fluidtypo3.org/viewhelpers/vhs/master/Page/InfoViewHelper.html
lib.pagetitle = RECORDS
lib.pagetitle {
source.data = page:uid
tables = pages
conf.pages = TEXT
conf.pages.field = nav_title
}
To get current page title:
lib.pagetitle = TEXT
lib.pagetitle.field=title
For meta data :
Its very important to place meta after header tag when we are gone through mobile compatible website
In order to prevent quirks mode in IE9 I need to add this lines at the very top of every HTML page:
You can write the whole header by yourself, by adding disableAllHeaderCode = 1 to your typoscript or you can hack it by adding your meta tag directly to the head tag:
page.headTag = <head><meta http-equiv="X-UA-Compatible" content="IE=edge" />
Place this at your typoscript
meta.X-UA-Compatible = IE=edge,chrome=1
httpEquivalent: (Since TYPO3 4.7) If set to 1, the http-equiv attribute is used in the meta tag instead of the “name” attribute. Default: 0.
For more information about TYPO3 stuff you may visit my blog
https://jainishsenjaliya.wordpress.com/2013/10/10/put-meta-tag-on-top-of-header-section-in-typo3/
If you want to use this in a fluid page template, you can also simple use:
{data.title}
to access the page title.
You can current page title by following typoscript:
lib.pagetitle = TEXT
lib.pagetitle.data = page : title
and then use this object to your page using typoscriptObjectPath like following way:
<f:cObject typoscriptObjectPath="lib.pagetitle"/>
If you want to use a fluid only solution, install the VHS extension and you can output the page title without using any TypoScript at all like this:
Tag Example:
<v:page.header.title title="NULL" whitespaceString="' '" setIndexedDocTitle="1">
<!-- tag content - may be ignored! -->
</v:page.header.title>
Inline Example:
{v:page.header.title(title: 'NULL', whitespaceString: '' '', setIndexedDocTitle: 1)}
lib.page_title = CONTENT
lib.page_title {
table = pages
select {
where = uid = 2
}
renderObj = COA
renderObj {
10 = TEXT
10 {
field = title
wrap = <h1 class="page_title">|</h1>
}
20 = TEXT
20 {
field = subtitle
stdWrap.required = 1
stdWrap.wrap = <h5>|</h5>
}
}
}
call the lib.page_title where want to render typoscript with this lines
<f:cObject typoscriptObjectPath='lib.page_title' />
I hope this helps !!!
The question is quite old but I still want to add something I never read here.
TYPO3 offers many things concerning the header, and it's right that it's also possible to render it completely individual. Nevertheless all the nice options of TYPO3 are more or less disabled by the individual solution.
So first the direct answer on the question:
The default page title can be overridden like this
config.pageTitle.stdWrap.override.cObject < lib.pagetitle
If several page types are defined and the title shall be set individually for each type, the configuration can be noted inside the page-definitions:
page = PAGE
page {
typeNum = 0
config.pageTitle.stdWrap.override.cObject < lib.pagetitle_1
...
}
anotherPage = PAGE
anotherPage {
typeNum = 1
config.pageTitle.stdWrap.override.cObject < lib.pagetitle_2
...
}
Below still a lib.pagetitle which makes a little bit more than only using title or subtitle - it uses news-title if the extension is used on a page:
lib.pagetitle = COA
lib.pagetitle {
10 = TEXT
10 {
// subtitle: used as field for title tag
value.field = subtitle // title
if.isFalse.data = GP:tx_news_pi1|news
}
20 = RECORDS
20 {
if.isTrue.data = GP:tx_news_pi1|news
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
htmlSpecialChars = 1
}
}
}
Now still some background why I think some individual header might not be the best solution:
TYPO3 usually adds several details to the header, that are useful and it's not required to combine those things individually new.
Scripts and stylesheets are organized and can be even by TypoScript compressed and merged. If some syntax is followed it even takes care that a library like jquery is only included once.
TYPO3 has many functions in TypoScript where everything can be defined related to the header and also it can be decided if scripts shall be perhaps never be included at all in the header but instead in the bottom of the page-source.
Metatags can be defined (and overridden by extensions or sub-templates)
Implementing this whole logic manually again in an own template in my opinion is not useful and I think headers should be only disabled for special page-types like AJAX or dynamic PDF-files. This is the primary reason that I consider that option as useful.
Her still the current link for the most recent documentation about the config-options in TypoScript (anchor pagetitle):
https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#pagetitle