In TYPO3 I built a Powermail form for frontend editing of extended fe_users. One field holds a comma separated list of categories, and I use a Typoscript lib to fill a group of checkboxes with the entries of sys_category for this field, trying to check the ones found in fe_users field. But there is no pre-selection.
Is it the nested CONTENT? Is it the renderObj? Where is the error? Any ideas?
lib.powermail.options {
category = CONTENT
category {
table = sys_category
select.pidInList = 41
renderObj = COA
renderObj {
10 = TEXT
10.field = title
20 = TEXT
20.value = |
30 = TEXT
30.field = uid
40 = TEXT
40.value = |*
40.if.isInList.field = uid
40.if.value = CONTENT
40.if.value {
table = fe_users
select {
pidInList = 41
where.dataWrap = uid = {TSFE:fe_user|user|uid}
}
renderObj = TEXT
renderObj.field = category
}
stdWrap.wrap = |[\n]
}
}
}
On the first view I can't see a problem. Nevertheless, if I have to build such a complex TypoScript object, I try to look at the result. Can you also use
page.1 < lib.powermail.options
and paste the result?
Related
I created a content element in TYPO3 (Ver. 11.5.9).
Now I want to finish my HTML-files with Fluid. But I can't display my data from my table of a database.
The Backend of the content element seems like so:
In a content element there are two tabs and in every tab I can add some child items.
My table in a database is so:
tt_content
tx_anreisetag_item (this is a table for a tab of Anreisetag)
tx_abreisetag_item (this is a table for a tab of Abreisetag)
The data of the child items are saved in the tablestx_anreisetag_item and tx_abreisetag_item.
I added three records in Anreisetag and two records in Abreisetag. But if I check a debug in the frontend, then I can see just two records of Abreisetag. I can't find no object of Anreisetag:
In typoscript I wrote this codes:
tt_content.klassenfahrt_anundabreisetag >
tt_content.klassenfahrt_anundabreisetag =< lib.contentElement
tt_content.klassenfahrt_anundabreisetag {
templateName = AnundAbreisetag
dataProcessing {
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 {
table = tx_anreisetag_item
pidInList.field = pid
where {
data = field:uid
intval = 1
wrap = tt_content=|
}
orderBy = sorting
}
30 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
30 {
table = tx_abreisetag_item
pidInList.field = pid
where {
data = field:uid
intval = 1
wrap = tt_content=|
}
orderBy = sorting
}
40 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
40 {
references.fieldName = tx_anreisetag_image
as = imageAnreise
}
50 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
50 {
references.fieldName = tx_abreisetag_image
as = imageAbreise
}
}
}
How can I register my another records of Anreisetag?
I hope someone can help me. Thank you.
You need to tell the DatabaseQueryProcessor the name of the records.
If you don't add
as = abreisetag
and also for the other call, both queries are stored in the variable named records. Then the first query will be overwritten by the second query.
Small hint: Use english variables.
I can't be sure as you have not provided your TCA and SQL declaration, but I assume you accessed the record with the uid, that is the count of relations.
TYPO3 inserts a field with the count of records, where the record relation is stored either in the related record (as a back link) or in mm-records.
I'm using TYPO3 7.6.10 and solr 6.5.0
Plugin: Apache solr for TYPO3 6.1.0
The search is working fine. I indexed Pages and News but when I get result of news it gives http://{plugin.tx_news.settings.detailpid}/ in URL instead of real URL.
I gave plugin.tx_news.settings.detailPid = 1130 in Constants of TYPOSCRIPT.
Please open below link and check the second result
http://www.fujifilm-mea.com/searchresult-page/?q=A+free+firmware+update+to+enhance+the+performance+of+the+FUJIFILM+X-Pro2+is+now+available+for+download&id=1263&L=0
What is configured in plugin.tx_solr.index.queue.news.fields.url?
At least there seems to be a diffrence in the casing (detailpid <=> detailPid)
plugin.tx_news.settings.detailpid
plugin.tx_news.settings.detailPid
in your root Setup:
plugin.tx_solr.index.queue {
news = 1
news {
table = tx_news_domain_model_news
fields {
abstract = teaser
author = author
authorEmail_stringS = author_email
title = title
content = SOLR_CONTENT
content {
cObject = COA
cObject {
10 = TEXT
10 {
field = bodytext
noTrimWrap = || |
}
}
}
url = TEXT
url {
typolink.parameter = {$plugin.tx_news.settings.detailPid}
typolink.additionalParams = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid}&L={field:__solr_index_language}
typolink.additionalParams.insertData = 1
typolink.useCacheHash = 1
typolink.returnLast = url
}
}
attachments {
fields = related_files
}
}
}
in root Constants:
plugin.tx_news.settings.detailPid = 3 //change "3" with ID of your NewsSingle Page
Clear all cache and Initialize Solr connections and re-index News again
The problem was for me in an old index. When correct pageUid added in constans.typoscript - need reindex news and all works
This is not a valid TypoScript constant:
{plugin.tx_news.settings.detailpid}
Please check your TypoScript Setup and change that to:
{$plugin.tx_news.settings.detailpid}
https://wiki.typo3.org/TypoScript_Constants
I have a trigger that moves the values from one object to another, but am stuck on how to move the values of the lookup fields from one to the other. what is the syntax? If you could show me the Company and the Chair_Rep ones that would be great!
<Lead> newLeadsList= new List<Lead>();
for (integer i=0; i<newContacts.size(); i++) {
if (newContacts[i].createlead__c == TRUE && oldContacts[i].createlead__c == FALSE ) {
newLeadsList.add(new Lead(
firstName = newContacts[i].firstName,
lastName = newContacts[i].lastName,
***Company = newContacts[i].account.name,***
Status = 'identified',
LeadSource = newContacts[i].leadsource ,
Product_Interest__c = 'CE',
//ContactLink__c = newContacts[i].ID,
Title = newContacts[i].title,
Email = newContacts[i].email,
//***Chair_Rep__c = newContacts[i].Chair_Rep__c***
Phone = newContacts[i].Phone,
MobilePhone = newContacts[i].MobilePhone,
// Address = newContacts[i].MailingAddress,
//Website = newContacts[i].Website,
nickname__c = newContacts[i].Nickname__c
Lookup fields should contain references (IDs) on records.
Is 'Company' a standard Lead field in your code?
***Company = newContacts[i].account.name,***
If so, then it's a Text(255) type field, which cannot be used as lookup.
If you need to make a lookup on a Contact's account record, then you can create a custom Lookup field on Lead with reference to Account. And then you could try this code (assuming ContactCompany is that custom lookup field :
ContactCompany__c = newContacts[i].AccountId
or
ContactCompany__c = newContacts[i].Account.Id
Chair_Rep__c and newContacts.Chair_Rep__c should be lookup fields on same object. Then this
Chair_Rep__c = newContacts[i].Chair_Rep__c
or this should work
Chair_Rep__c = newContacts[i].Chair_Rep__r.Id
I have movies datastore, each record there has its own id as key name like below:
12345
32453
12154
78873
34543
I would like to allow user to browse movies one by one. Firstly, the latest movie should be shown (database has field added with date and time). How to get that from the datastore?
Upd. I can do it like below:
movies = Movies.query()
movies.order(-Movies.added)
for movie in movies.fetch(1):
self.response.out.write(movie.key.id())
But I don't like it - in order to get key I request the whole record.
Secondly, if some other movie is shown (for ex., 12154), user should be able to go to previous movie (id 32453) and next movie (id 78873). Of course, if last movie is shown, there will not be next movie; and if first movie is shown, there will not be previous movie. So, the question is how to get key names of next and previous movies?
Upd. If current movie shown is 12154, then I should generate links like example.com/movie/32453 for previous movie and example.com/movie/78873 for the next one.
Upd. I've tried something like below:
next_movie = Movies.query(Movies.added < movie.added)
next_movie = next_movie.order(-Movies.added)
next_movie = next_movie.get()
if next_movie:
next_url = next_movie.key.id()
else:
next_url = ''
prev_movie = Movies.query(Movies.added > movie.added)
prev_movie = prev_movie.order(-Movies.added)
prev_movie = prev_movie.get()
if prev_movie:
prev_url = prev_movie.key.id()
else:
prev_url = ''
But it doesn't work well... next_url seems to be OK, but prev_url always the same. Here is my test database content (-Movies.added order):
id added
503035: 2012-08-05 19:49:51.259000
475537: 2012-08-05 19:49:51.238000
677539: 2012-08-05 19:49:51.218000
566355: 2012-08-05 19:49:51.197000
557850: 2012-08-05 19:49:51.176000
670146: 2012-08-05 19:49:51.155000
581030: 2012-08-05 19:49:51.135000
464561: 2012-08-05 19:49:51.114000
507817: 2012-08-05 19:49:51.092000
First you need a property on your movie entity that would represent "lateness", e.g. a date filed when movie was inserted in database.
Then you should use query with descending sort on this field.
To skip to next/previous you should use Query Cursors.
the following codes works well:
next_movie = Movies.query(Movies.added < movie.added)
next_movie = next_movie.order(-Movies.added)
next_movie = next_movie.get(keys_only = True)
if next_movie:
next_url = next_movie.id()
else:
next_url = ''
prev_movie = Movies.query(Movies.added > movie.added)
prev_movie = prev_movie.order(Movies.added)
prev_movie = prev_movie.get(keys_only = True)
if prev_movie:
prev_url = prev_movie.id()
else:
prev_url = ''
return next_url, prev_url
I have a requirement to display lists of newly-created and updated pages in our Episerver intranet - say the last ten of each. I've tried using FindPagesWithCriteria but this returns no results. Here's the code I've tried:
PageDataCollection recentPages;
PropertyCriteriaCollection criteria;
PropertyCriteria upperBound;
PropertyCriteria lowerBound;
criteria = new PropertyCriteriaCollection();
upperBound = new PropertyCriteria();
upperBound.Condition = CompareCondition.LessThan;
upperBound.Type = PropertyDataType.Date;
upperBound.Value = DateTime.Today.ToString();
upperBound.Name = "Created"; // Or Saved for updated pages
criteria.Add(upperBound);
lowerBound = new PropertyCriteria();
lowerBound.Condition = CompareCondition.GreaterThan;
lowerBound.Type = PropertyDataType.Date;
lowerBound.Value = DateTime.Today.AddDays(-7).ToString();
lowerBound.Name = "Created";
criteria.Add(lowerBound);
recentPages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criteria);
I've also tried using the RecentlyChangedPagesFinder (as detailed here) - this returns some results, but when I try to use the set of results to build a PageCollection to databind into a PageList, again I get nothing output. And I can't see that I could use that for new pages, only updated ones.
The property name should be "PageCreated".
http://epiwiki.se/developing/properties/all-built-in-properties
You can also improve your FindPagesWithCriteria-syntax by going something like this:
var criterias = new PropertyCriteriaCollection
{
new PropertyCriteria()
{
Name = "SomeProp",
Type = PropertyDataType.PageType,
Value = "eh",
Condition = CompareCondition.Equal,
Required = true
},
new PropertyCriteria()
{
...
};
var pages = DataFactory.Instance.FindPagesWithCriteria(somePageLink, criterias);