Is there a way to get the website name using TypoScript?
In my TypoScript template I am using
data = page : name
to get the name of the current page I am on e.g. About.
I need to get the webiste name as well, so I have tried
data = site : name
but this is not correct and I can't find the correct data name for the website name in the documentation.
NOTE: by website name I mean the Sitename entered in the template settings.
I found this solution on http://www.sk-typo3.de/Seitentitel-aendern.58.0.html from Waldgeist. It reads from the TSFE without a DB query.
lib.siteTitle = TEXT
lib.siteTitle{
data = TSFE:tmpl|sitetitle
attribute = property
}
With line below you need to know used uid of the TypoScript template entry from table sys_template, where uid=1 in example below:
data = DB:sys_template:1:title
Or maybe you want use the sitename as set for your installation:
data = GLOBAL:TYPO3_CONF_VARS|SYS|sitename
Related
I want to switch the type of my typo3 website e.g. for xml or json output, but the system ignores the get parameter type. I don't know what I'm doing wrong or if there is a bug.
typoscript example
testtype = PAGE
testtype.typeNum = 13
testtype.10 = TEXT
testtype.10.value = test
testtype.config.disableAllHeaderCode = 1
my site config
https://pastebin.com/UsdZGq7N
You make use of the PageType routeEnhancer, when that is active you have to map all the page-types you use. Otherwise it gets stripped from the url.
Also, the PageType routeEnhancer should be the last enhancer you configure, as it modifies existing route variants:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Routing/Enhancer/PageTypeDecorator.php#L25
For a google spreadsheet it is easy to change the filename by using this script:
var file = SpreadsheetApp.openById(Idfile);
file.rename("new name");
Logical to me for change file name of a form:
var form = FormApp.openById(Idform);
form.rename("new name");
However this does not work!
Who knows the solution to change a filename of a google form by using apps script?
How about this method?
DriveApp.getFileById(id).setName("new name");
This method can also rename Spreadsheet.
Reference :
setName(name)
I'm using out-of-the-box Alfresco 4.2.f, without customizations, and i'm trying to set the email notification whether a new document in added in a certain folder.
So i've added a rule to the folder and i've set as Perform Action "Send email" using as template "notify_user_email_it.html.ftl".
If i insert a document, i don't receive the email and here is the error in the log:
Expression person is undefined on line 38, column 57 in workspace://SpacesStore/55088e2c-05ac-4264-8396-ee6f3c7021ad.
The problematic instruction:
----------
==> ${person.properties.firstName} [on line 38, column 55 in workspace://SpacesStore/55088e2c-05ac-4264-8396-ee6f3c7021ad]
----------
If i remove from the template the string ${person.properties.firstName} then the rule works properly but the mail i receive is not as expected, all the interesting informations are shown as in the original FTL. Attached the email received to understand better.
Really strange since i've not customized anything, maybe this is a BUG but i didn't find anything on JIRA...
Someone has the same behaviour? Possible work-arounds?
Thanks in advance!
According to this JIRA, it's not really a bug it just doesn't work for the admin user.
Have you tried it with a normal user?
--- Update ---
Maybe cause it's bug or an unimplemented feature something like the following to fix it in the template:
<#if person??>
.... set your person properties first & lastname
<#else>
.... is sure to be admin, so set the admin
</#if>
You have to pass the parameters to emails templates
you may try with this example
var template = "Data Dictionary/Email Templates/Workflow Notification/<<Your File>>.html.ftl";
var mail = actions.create("mail");
mail.parameters.to = "xyx#gmail.com";
mail.parameters.subject="Hello";
mail.parameters.text="blablabla";
mail.parameters.template = companyhome.childByNamePath(template);
var templateArgs = new Array();
templateArgs['workflowTitle'] = "789789";
templateArgs['workflowDescription'] = "879789";
templateArgs['workflowId'] = "879789";
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
mail.execute(bpm_package);
then you can get parameters using ${args.workflowTitle} in your Email template ftl file
I created an extension with a domain model Message. This model has a relation m:n with the TYPO3 pages (the one which has the details of the pages, like title, issite_root etc) table. However, by using the mapping to existing tables option, it gives me type error saying page :
The configured type field for table "pages" is of type int(11) unsigned
This means the type field can not be used for defining the record type.
You have to configure the mappings yourself if you want to map to this
table or extend the correlated class
So I just create the relation without mapping, so that I can later map it from setup.txt.
The I created model Pages in MyExt/Classes/Domain/Model/ with all the getters/setters and repository in MyExt/Classes/Domain/Repository/.
In my setup.txt I did this:
config.tx_extbase {
persistence{
enableAutomaticCacheClearing = 1
updateReferenceIndex = 0
classes {
Tx_Playfield_Domain_Model_Pages {
mapping {
tableName = pages
columns {
uid.mapOnProperty = uid
pid.mapOnProperty = pid
sorting.mapOnProperty = sorting
title.mapOnProperty = title
subtitle.mapOnProperty = subtitle
}
}
}
}
}
}
But when I try to access the Pages model I created,
var_dump($this->pagesRepository->findByUid(74));
its searching for tx_playfield_domain_model_pages which does not exists, it shows
Table 'typo3.tx_playfield_domain_model_pages' doesn't exist: SELECT tx_playfield_domain_model_pages.* FROM tx_playfield_domain_model_pages WHERE tx_playfield_domain_model_pages.uid = '74' LIMIT 1
What am I missing here?
Update
After following http://t3-developer.com/extbase-fluid/cheats-extbase/model/tabelle-pages-in-extbase/ suggested by #Michael I get an empty result from $this->pagesRepository->findByUid(74)
setup.txt is loading. I did this to check it:
plugin.tx_playfield{
settings{
temp=yes
}
}
And this is being accessed from my controller.
Is it possible that you didn't create the Pages domain model (within the extension builder or not at all)? The file my_ext/Classes/Domain/Model/Pages.php needs to exist. Check that your "Pages" domain model has the property Map to existing table set to pages, it should look like that:
I don't know where exactly your error is, but I did some more tinkering in the extension builder and made it work. You can probably find out by comparing your extension playfield to my temporary extension testfield: Download it here (updated).
Btw, you don't need to map properties that you do not want to be displayed in the frontend unless they are named differently.
mapping {
tableName = pages
columns {
title.mapOnProperty = title
subtitle.mapOnProperty = subtitle
}
}
I think you have to write the mapping with camel case letters (the class name). Although this post is in German, I think the code might help you. The author added some fields he is going to use to the class and also added a mapping in the typoscript of the extension (see the example code there). The most important part of the German text is that this example there was designed only to read from the db. If you want to create new pages using the model, you have (at least) to add the TCA and setters in the model class to make it work.
I am creating this below block content in admin HTML. I cant able to get the slidertype attributes in 3columns.phtml but in template page i can get
$this->getData('slidertype').
So kindly give the solution that how to get the following attributes.
{{block type="catalog/product_bestseller" name="bestseller" slidercount="20" slidertype="1" template="catalog/product/bestseller_right.phtml"}}
I am using the below code to get static block attribute value. Its working fine for us.
$bestSellerBlock = Mage::getModel('cms/block')
->setStoreId(Mage::app()->getStore()->getId())
->load("best_seller");
$bestSellerContentText = strip_tags($bestSellerBlock->getContent());
preg_match('/slidertype="(.*?)"/u',$bestSellerContentText,$sliderTypeArray);
$sliderType = trim($sliderTypeArray[1]);
Thanks,
Arularasan D.