<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>database</type>
<description>Language labels for extension 'dagou_user'</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<!-- Email -->
<label index="email_notify_employer_body"><![CDATA[A new Employer has signed up!<br /><br />Account Name: ###USERNAME###<br />Email: ###EMAIL###<br />Full Name: ###NAME###<br />Company Name: ###COMPANY###<br />Location: ###CITY### ###STATE###, ###ZIP###]]></label>
<label index="email_notify_employer_subject">New Employer</label>
...
</languageKey>
</data>
</T3locallang>
Above code is taken from locallang_dagouuser.xml, meanwhile I am reading this document: http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/7/2/
Questions:
For type="array", is there any other value I can assign for type? such as type="string"...
<type>database</type>, in the document, it is said "database" : Used for labels of database tables and fields., what does this mean? how could I use these labels with DB tables and fields?
No, there is just this one type.
This is just a hint for the reader what the purpose of this language file is. When you take at look at the TCA of the extension, you will see something like
'label' => 'LLL:EXT:cms/locallang_ttc.xml:sys_language_uid_formlabel'
This is one of the places those language labels for database fields are used.
Related
How can I get a translation string in TYPO3 Backend?
In language overview in Backend, I have my custom Content Elements displayed.
If there is no link title set, the button has a language specific default value:
EN: Read more
DE: Mehr erfahren
In Frontend, we have <f:translate, but in Backend this does not work?
Version: TYPO3 V10 LTS
depending on where your label is. the string is defined in TCA (Table Configuration Array) or Flexform. in both cases you use an LLL reference instead of the label
usually somthing like this:
LLL:EXT:my_ext/Resources/Private/Language/backend.xlf:my_label_name
let me pick explain the diffrent parts:
LLL: proccess this aht Local Language resource (similar to http: in an URL)
EXT: this is an Extension Path chheck prefixes like typo3conf/ext/ or typo3/sysext
my_ext/Resources/Private/Language/backend.xlf the path to the file
:my_label_name the label inside the file
<f:translate> does work in the backend as well.
The language file should at least look like:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-08-22T11:22:55Z" product-name="efemtpy">
<header/>
<body>
<trans-unit id="title">
<source>Title</source>
</trans-unit>
</body>
</file>
</xliff>
Maybe you forgot the <source>-Tag like I did before.
What is the best way to render link field in TYPO3 fluid template?
Link field is defined via flexform as:
<field_link type="array">
<TCEforms type="array">
<config type="array">
<type>input</type>
<eval>trim</eval>
<wizards type="array">
<link type="array">
<type>popup</type>
<title>Link</title>
<icon>link_popup.gif</icon>
<script>
browse_links.php ? mode = wizard & amp;
act = page
</script>
<params type="array">
<blindLinkOptions>file,spec,email,folder</blindLinkOptions>
</params>
<JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
</link>
</wizards>
</config>
<label>link</label>
</TCEforms>
</field_link>
Fluid comes with viewhelpers such as link.email, link.external, link.page but my link field could be either page id or external link or email or link to sys_file record. How do you handle that in your projects without making multiple if statemens in fluid template? (custom viewhelper?, typoscript object)?
You can also use the f:link.page to generate links external urls or files, that does not matter as internally typolink is used.
If you are using the wizards like in your example, you should use the f:link.typolink viewhelper which supports all attributes.
Link for email works perfect
here my flexform:
<settings.link>
<TCEforms>
<label>Link</label>
<config>
<type>input</type>
<size>30</size>
<eval>trim</eval>
<softref>typolink,typolink_tag,images,url</softref>
<wizards>
<_PADDING>2</_PADDING>
<link>
<type>popup</type>
<title>Link</title>
<module>
<name>wizard_element_browser</name>
<urlParameters>
<mode>wizard</mode>
</urlParameters>
</module>
<icon>link_popup.gif</icon>
<script>browse_links.php?mode=wizard</script>
<params>
<blindLinkOptions>file,folder,url,spec</blindLinkOptions>
</params>
<JSopenParams>height=500,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
</link>
</wizards>
</config>
</TCEforms>
</settings.link>
Output:
Liunk
We have a XML file that is on somewebsite and looks in a way like this (confidential parts stripped)
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://somewebsite.com/crm/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Accounts</title>
<id></id>
<updated>2016-02-04T08:36:56Z</updated>
<link rel="self" title="Accounts" href="Accounts" />
<entry>
<title type="text"></title>
<updated>2016-02-04T08:36:56Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Type>A</d:Type>
<d:UniqueTaxpayerReference m:null="true" />
<d:VATLiability m:null="true" />
<d:VATNumber m:null="true" />
<d:Website m:null="true" />
</m:properties>
</content>
</entry>
<link rel="next" href="https://somewebsite.com/Accounts?$skiptoken=guid'ee6bc390-a8ac-4bbd-8a4d-0a1f04ab9bd3'" />
</feed>
We use the new Rest connector to get the data out of this XML file.
The XML has pagination and every 60 entries you can load the next 60 with the link at the bottom of this xml file.
The problem i have is when, in the REST connector, we want to enable pagination with these setting:
Pagination Type: Next URL
Next URL field path:
/*[name()="feed"]/*[name()="link"][contains(#rel,"next")]/#href
It doesn't seem to work...
side note: the XML file has namespaces so i need to target the elements this way instead of /feed/link/...
I'm using Xpath syntax to target the link href, but maybe this is not the way to go? Or maybe the REST connector isn't using Xpath syntax?
Really hope someone can help me!
Actually it turns out that this seems to be due to a "bug" in the "Qlik REST Connector 1.0" so the pagination doesn't work.
But there is a fix for it:
1) Make sure that the Qlik REST Connector 1.0 connect dialog box has the NextUrl set to:
feed/link/attr:href
2) When the SQL has been generated after using the SELECT-button and going through the wizard you have to modify the sub-SELECT that reads like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href" AS href,
"__FK_link"
FROM "link" FK "__FK_link"),
.....
On line 05 you will have to remove the text AS href.
So it should look like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href",
"__FK_link"
FROM "link" FK "__FK_link"),
....
3) Find the LOAD statement that loads from this sub-select with a RESIDENT [MasterREST further down in the load script and make sure that the reference to href is changed to [attr:href] - or else you will get an error message while loading.
Should look like this after the change:
[link]:
LOAD [rel],
[title],
[attr:href],
[__FK_link] AS [__KEY_feed]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_link]);
This worked for me:
/*[name()='feed']/*[name()='link'][#rel='next']/#href
Yours should also work actually, maybe whatever you are using does not agree with double quotes instead of single quotes.
I have 2 tables, DATA and IMAGES, in a relationship based on item_number.
Records in DATA each have 3 records from IMAGES gathered.
For example, a record with item_number 010050 is linked to these records in IMAGES:
010050.eps
010050_table.tif
010050_drawing.png
In the corresponding record in DATA I have the fields:
main
table
drawing
My aim is to set the fields in DATA like:
010050.eps => main
010050_table.tif => table
010050_drawing.png => drawing
I tried:
ExecuteSQL("SELECT filename FROM images WHERE filename = ?"; ""; ""; "010050_drawing")
Who could give me a hint?
I couldn't figure out how I can do that in xslt.
To take a simplified example, suppose you have exported from your Data table, with only two fields included in the export: Data::ItemNumber and Images::FileName. Your raw export would then look something like this (two records shown):
XML
<?xml version="1.0" encoding="UTF-8"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="FileMaker" VERSION=""/>
<DATABASE DATEFORMAT="" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT=""/>
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="ItemNumber" TYPE="NUMBER"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Images::FileName" TYPE="NUMBER"/>
</METADATA>
<RESULTSET FOUND="2">
<ROW MODID="0" RECORDID="1">
<COL>
<DATA>010050</DATA>
</COL>
<COL>
<DATA>010050.eps</DATA>
<DATA>010050_table.tif</DATA>
<DATA>010050_drawing.png</DATA>
</COL>
</ROW>
<ROW MODID="0" RECORDID="2">
<COL>
<DATA>2345</DATA>
</COL>
<COL>
<DATA>2345_extra.gif</DATA>
<DATA>2345_table.gif</DATA>
<DATA>2345_drawing.jpg</DATA>
<DATA>2345.tiff</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
Note the different order as well as the extra image in the second record.
After applying the following stylesheet:
XSLT
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpxmlresult"
exclude-result-prefixes="fmp">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<root>
<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
<xsl:variable name="item-no" select="fmp:COL[1]/fmp:DATA"/>
<item>
<number>
<xsl:value-of select="$item-no"/>
</number>
<main>
<xsl:value-of select="fmp:COL[2]/fmp:DATA[starts-with(., concat($item-no, '.'))]"/>
</main>
<table>
<xsl:value-of select="fmp:COL[2]/fmp:DATA[starts-with(., concat($item-no, '_table.'))]"/>
</table>
<drawing>
<xsl:value-of select="fmp:COL[2]/fmp:DATA[starts-with(., concat($item-no, '_drawing.'))]"/>
</drawing>
</item>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
you would obtain:
Result
<?xml version="1.0" encoding="UTF-8"?>
<root>
<item>
<number>010050</number>
<main>010050.eps</main>
<table>010050_table.tif</table>
<drawing>010050_drawing.png</drawing>
</item>
<item>
<number>2345</number>
<main>2345.tiff</main>
<table>2345_table.gif</table>
<drawing>2345_drawing.jpg</drawing>
</item>
</root>
Honestly, unless there's more happening than what you've described, you're making this too hard.
If there will always be exactly 3 IMAGE records for each DATA record, and especially if you want to directly relate each image to a specific type, you don't need the IMAGE table. A much simpler solution would be to add 3 container fields to your DATA table (say, main_image, table_image, drawing_image). You wouldn't need SQL or a portal, and you wouldn't have to worry about keeping related images linked to their type.
OTOH, if you truly need a separate table, consider hard-wiring three dedicated 1:1 relationships, one for each image type. To do this, add 3 special key fields in DATA: (main_image_id, etc.) and create a relationship for each image type, each between one of these fields and the primary IMAGE. Then, whenever you create a DATA record and 3 related IMAGE records, put the key of the matching image in the matching DATA::xxx_image_id field. That way, you'd have a clean 1:1 relationship, and each related image would be locked to its type.
thanks for your replies
I need the value of the images in those fields to get it exported to XML and InDesign (into table cells).
The issue is that I know the filenames , namely the item_number followed by _drawing or _table, but don't know the extension on forehand (many files and from different sources)
File formats differ therefore.
My solution now is:
- imported all the images in a related (item_number, his is also part of the filename) a FMP table
- I calculated whether the file is a table, drawing or illustration and put those values in a field 'kind' by:
Case (
PatternCount ( filename ; "_drawing." ) ;
"drawing" ;
PatternCount ( filename ; "_table." ) ;
"table" ;
Length ( filename )=10 ;
"main" ;
""
)
- then I did the query in each of the fields, main - table - drawing. The one below is the calculation in the 'table' field.
ExecuteSQL("
SELECT path_xml
FROM images
WHERE item_number = ? and kind = ?";
"";""; item_number ; "table"); ""
)
Perhaps a bit clumsy, but it works now.
I'm using the Typo3 Formhandler extension to build a simple reaction form. The form works correctly only the error response is in English and not translated. By typoscript I included a languest file.
langFile = fileadmin/templates/sandraverdijck/lang/newsletter.xml
The languest file includes the Dutch translation, see file below.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<data type="array">
<languageKey index="default" type="array">
<label index="error_sender_name_required">Naam is verplicht</label>
<label index="error_sender_email_required">Email is verplicht</label>
<label index="error_sender_email_email">Email is niet correct ingevult</label>
</languageKey>
</data>
</T3locallang>
The response is still in English like "Your name is missing", I don't know where it gets this from and why it is not using the text from the languest file? When I don't include the languest file I get an error so the file is used. Anyone some idee?
Your language key is default. Is Dutch the default language of the website? Are you setting the language through
config.language = dk
? If so, try using the according language code in the XML file:
<languageKey index="dk" type="array">