I need to be able to search by the News Tags property.
This typoscript is working fine, but when I input a tag (exact same string) from a News into Solr's search box I don't get any results.
According to "lorenz" in this answer I neede to add my dynamic fields (I believe) to "plugin.tx_solr.query.fields" but this poor documentation doesn't help me.
I added the following to that typoscript but when I use the searchbox to look for exactly the name of my tag I get no results.
(plugin.tx_solr.query.fields = tags_stringM)
Does anybody have any code that I can use as an example?
plugin.tx_solr{
search {
initializeWithEmptyQuery = 1
showResultsOfInitialEmptyQuery = 1
showEmptyFacets = 1
faceting = 1
faceting {
facets {
mediatype {
label = Facet dos
field = categorytitle_stringS
}
}
}
}
index.queue {
custom_news = 1
custom_news {
table = tx_news_domain_model_news
fields {
abstract = teaser
author = author
authorEmail_stringS = author_email
title = title
datetime_stringS = TEXT
datetime_stringS {
field = datetime
date = d.m.Y H:i
}
titlehr_stringS = TEXT
titlehr_stringS {
field = title_hr
}
teaser_stringS = TEXT
teaser_stringS {
field = teaser
}
datetime_dateS = TEXT
datetime_dateS {
field = datetime
date = Y-m-d\TH:i:s\Z
}
content = SOLR_CONTENT
content {
cObject = COA
cObject {
10 = TEXT
10 {
field = bodytext
noTrimWrap = || |
}
20 = TEXT
20 {
field = tags_stringM
noTrimWrap = || |
}
}
}
categorytitle_stringS = SOLR_RELATION
categorytitle_stringS {
localField = categories
multiValue = 1
}
categoryuid_stringS = SOLR_RELATION
categoryuid_stringS {
localField = categories
foreignLabelField = uid
multiValue = 1
}
keywords = SOLR_MULTIVALUE
keywords {
field = keywords
}
tags_stringM = SOLR_RELATION
tags_stringM {
localField = tags
label = Tags
multiValue = 1
}
tagshr_stringM = SOLR_RELATION
tagshr_stringM {
localField = tags
label = Tags hr
foreignLabelField = title_hr
multiValue = 1
}
mediatypehr_intS = TEXT
mediatypehr_intS {
field = media_type_hr
}
mediatypede_intS = TEXT
mediatypede_intS {
field = media_type_de
}
image_stringS = FILES
image_stringS {
references {
table = tx_news_domain_model_news
uid.field = uid
fieldName = fal_media
}
begin = 0
maxItems = 1
renderObj = IMG_RESOURCE
renderObj {
file.import.data = file:current:publicUrl
file.maxW = 330
#wrap = |
}
}
url = CASE
url {
key.field = type
# Internal
1 = TEXT
1 {
if.isTrue.field = internalurl
typolink.parameter.field = internalurl
typolink.useCacheHash = 1
typolink.returnLast = url
}
# External
2 = TEXT
2 {
if.isTrue.field = externalurl
field = externalurl
}
default = TEXT
default {
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 = 1
attachments {
fields = fal_related_files
fileExtensions = *
}
}
}
}
plugin.tx_solr.logging.indexing.queue.news = 1
Aside from defining the fields for indexing you also need to declare these fields as relevant for search. (and with a weight how important they are for searching)
One possible solution could be like in this part of typoscript:
plugin {
tx_solr {
search {
query {
queryFields := addToList(categorytitle_stringS^2.0,keywords2.0,tags_stringM^2.0, tagshr_stringM^2.0)
}
}
}
}
see manual
I use the following TS from documentation (apache-solr-for-typo3) for a simple facet
plugin.tx_solr.search {
faceting = 1
faceting {
facets {
contentType {
label = Content Type
field = type
}
}
}
}
The result is e.g.
sys_file_metadata (691)
tt_address (341)
tx_news_domain_model_news (180)
pages (153)
tx_events2_domain_model_event (2)
How can I rename e.g. tt_address to Personen and the other titles for better readability?
Here is my configuration for tt_address
plugin.tx_solr.index.queue {
tt_address = 1
tt_address {
table = tt_address
lable = Personen
additionalWhereClause = first_name NOT LIKE ''
fields {
abstract = position
description = description
title = name
personen_stringS = Personen
content = SOLR_CONTENT
content {
field = title
}
url = TEXT
url {
typolink.parameter.field = detail
typolink.returnLast = url
typolink.useCacheHash = 0
}
}
}
}
TYPO3 10.4.18., solr 11.0.4
It's not at the queuing where you set the label.
plugin {
tx_solr {
search {
faceting = 1
faceting {
facets {
# contentType {
# label = Content Type
# field = type
# }
contentType {
label = Filter
field = type
renderingInstruction = CASE
renderingInstruction {
key.field = optionValue
pages = TEXT
pages.value = Internetseiten
tx_solr_file = TEXT
tx_solr_file.value = Dateien
tx_news_domain_model_news = TEXT
tx_news_domain_model_news.value = Nachrichten
tt_address = TEXT
tt_address.value = Adressen
}
}
:
[TYPO3 8.7, ext_solr 9.0]
I have a custom extension for events. Solr should index the field startdate but doesn't. Everything else works fine.
plugin.tx_solr.index.queue {
events = 1
events {
table = tx_customevents_domain_model_event
fields {
title = title
abstract = teaser
startdate_intS = startdate
content = SOLR_CONTENT
content {
field = bodytext
}
url = TEXT
url {
typolink {
parameter = {$plugin.tx_customevents_list.settings.singelePid}
additionalParams = &tx_customevents_list[event]={field:uid}&tx_customevents_list[action]=show&tx_customevents_list[controller]=Event
additionalParams.insertData = 1
returnLast = url
useCacheHash = 1
}
}
}
}
}
plugin.tx_solr.search.query.queryFields := addToList(startdate_intS^1.0)
The Fluid debugger does not show it in the resultSet object, even after having emptied the index queue.
What am I missing here?
I got a website to move to our server and I have successfully moved it.But I have noticed some strange thing.Site doesn't render Danish characters (only special characters).When when I try to save using htmlarea in admin section and I can save Lorem Ipsum with any issue.But special danish characters are seems saving to database but when I open htmlarea it shows nothing.
Seems me there should be some configuration or settings to do.I tried to change character set but didnt work.Then whole db and table change to Utf8.No luck.
Anyone is having an idea to fix this?
please mentioned the place and page name as I am totally newbie to typo3
Thanks
More info regarding typo3 ond utf8 you can find there - http://wiki.typo3.org/UTF-8_support (TYPO3 UTF-8 support). Which TYPO3 version you have?
I think you have to modify your page typoscript configuration.
set htmlSpecialChars = 0 at the time of both entryHTMLparser_db and exitHTMLparser_db.
Use below page typoscript configuration. Might be your problem will be solved.
mod.SHARED {
defaultLanguageFlag = de
defaultLanguageLabel = Deutsch
}
# Classes. Do not forget to define them in the CSS class
RTE.classes {
# lists
checklist {
name = Checkliste
}
# tables
table {
name = Normale Tabelle
}
table-condensed {
name = Verkürzte Tabelle
}
table-bordered {
name = Tabelle mit Rahmen
}
table-styled {
name = Tabelle mit anderem Design
}
table-striped {
name = Tabelle mit Streifen
}
table-hover {
name = Tabelle mit Hover-Effekt
}
# aligns
align-justify {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyfull
}
align-left {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyleft
value = text-align: left;
}
align-center {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifycenter
value = text-align: center;
}
align-right {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyright
value = text-align: right;
}
csc-frame-frame1 {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame1
value = background-color: #EDEBF1; border: 1px solid #333333;
}
csc-frame-frame2 {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame2
value = background-color: #F5FFAA; border: 1px solid #333333;
}
important {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:important
value = color: #8A0020;
}
name-of-person {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:name-of-person
value = color: #10007B;
}
detail {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:detail
value = color: #186900;
}
component-items {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
value = color: #186900;
}
action-items {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
value = color: #8A0020;
}
component-items-ordered {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
value = color: #186900;
}
action-items-ordered {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
value = color: #8A0020;
}
style1 {
name = Stil 1
}
htmlCode {
name = HTML Code
}
phpCode {
name = PHP Code
}
}
RTE.classesAnchor {
externalLink {
class = external-link
type = url
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_titleText
}
externalLinkInNewWindow {
class = external-link-new-window
type = url
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_titleText
}
internalLink {
class = internal-link
type = page
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_titleText
}
internalLinkInNewWindow {
class = internal-link-new-window
type = page
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_titleText
}
download {
class = download
type = file
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_titleText
}
mail {
class = mail
type = mail
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_titleText
}
more-link {
class = more-link
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
}
button-link {
class = btn
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
}
next-link {
class = ym-button ym-next
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_altText
}
back-link {
class = back-link
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_altText
}
}
RTE.default {
showButtons = *
## Enable the image button
showButtons := addToList(image)
defaultContentLanguage = de
// Make possible to read classes from the contentCSS CSS file
buttons.textstyle.tags.span.allowedClasses >
buttons.textstyle.tags.REInlineTags >
buttons.textstyle.REInlineTags >
buttons.blockstyle.tags.table.allowedClasses >
buttons.blockstyle.tags.p.allowedClasses >
buttons.blockstyle.tags.div.allowedClasses = align-left, align-center, align-right
buttons.blockstyle.tags.div.allowedClasses := addToList(csc-frame-frame1, csc-frame-frame2)
buttons.blockstyle.tags.table.allowedClasses = csc-frame-frame1, csc-frame-frame2
buttons.blockstyle.tags.td.allowedClasses = align-left, align-center, align-right
buttons.textstyle.tags.span.allowedClasses = important, name-of-person, detail
contentCSS = typo3conf/ext/fluxtemplate/Resources/Public/CSS/rte.css
buttons.formatblock.prefixLabelWithTag = 1
buttons.link.relAttribute.enabled = 1
buttons.link.queryParametersSelector.enabled = 1
buttons.link.properties.class.allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
buttons.link.page.properties.class.default = internal-link
buttons.link.url.properties.class.default = external-link-new-window
buttons.link.file.properties.class.default = download
buttons.link.mail.properties.class.default = mail
buttons.image.properties.class.allowedClasses = img-responsive
// Disable contextual menu
contextMenu.disabled = 1
// Display status bar
showStatusBar = 1
//More toolbar options
keepButtonGroupTogether = 1
// Use CSS formatting when possible
useCSS = 1
// Make rtehtmlarea resizable
rteResize = 1
proc {
allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
allowedClasses := addToList(detail,align-left, align-center, align-right, align-justify, csc-frame-frame1, csc-frame-frame2, component-items, action-items, component-items-ordered, action-items-ordered, important, name-of-person, indent, img-responsive)
allowedClasses < RTE.default.classesCharacter
# auskommentieren, damit klassen eingelesen werden können
#allowedClasses := addToList( dimmed,highlight,box,info,success,warning,error,float-left,float-right,center,align-left,align-center,align-right,align-justify,style1 )
## TAGS ALLOWED OUTSIDE P & DIV
allowTagsOutside := addToList( pre, img )
allowTags := addToList( pre )
// Tags allowed in Typolists
allowTagsInTypolists = br,font,b,i,u,a,img,span
// Keep unknown tags
dontRemoveUnknownTags_db = 1
// Allow tables
preserveTables = 1
entryHTMLparser_db = 1
entryHTMLparser_db {
// Tags allowed
allowTags < RTE.default.proc.allowTags
// Tags denied
denyTags >
// HTML special characters
htmlSpecialChars = 0
// Allow IMG tags
tags.img >
// Additionnal attributes for P & DIV
tags.div.allowedAttribs = class,style,align
tags.p.allowedAttribs = class,style,align
// Tags to remove
removeTags = center, font, o:p, sdfield, strike, u
// Keep non matched tags
keepNonMatchedTags = protect
}
// HTML parser
HTMLparser_db {
// Strip attributes
noAttrib = br
// XHTML compliance
xhtml_cleaning = 1
}
// Exit HTML parser
exitHTMLparser_db = 1
exitHTMLparser_db {
// Remap bold and italic
tags.b.remap = strong
tags.i.remap = em
// Keep non matched tags
keepNonMatchedTags = 1
// HTML special character
htmlSpecialChars = 0
}
}
}
RTE.default.FE < RTE.default
RTE.default.FE.showButtons < RTE.default.showButtons
RTE.default.FE.proc.allowTagsOutside < RTE.default.proc.allowTagsOutside
RTE.default.FE.proc.entryHTMLparser_db.tags.img >
// PageTSConfig
TCEFORM.tt_content.header_layout.altLabels {
0 = H1 (Default)
1 = H1
2 = H2
3 = H3
4 = H4
5 = H5
}
I also have same problem in my another project.
First set default_charset to utf8 in your php.ini file.
or you can manuaaly set it with below PHP code:
ini_set('default_charset', 'utf8');
Lead - gets converted to an Account , Contact and an Opportunity
I developed a trigger which shares an Opportunity and related Account with another Org of ours, and the piece i am missing is sharing the Contact along with this . Need some help for sharing the contact also.
Trigger autoforwardOpportunity on Opportunity(after insert) {
String UserName = UserInfo.getName();
String orgName = UserInfo.getOrganizationName();
List<PartnerNetworkConnection> connMap = new List<PartnerNetworkConnection>(
[select Id, ConnectionStatus, ConnectionName from PartnerNetworkConnection where ConnectionStatus = 'Accepted']
);
System.debug('Size of connection map: '+connMap.size());
List<PartnerNetworkRecordConnection> prncList = new List<PartnerNetworkRecordConnection>();
for(Integer i =0; i< Trigger.size; i++) {
Opportunity Opp = Trigger.new[i];
String acId = Opp.Id;
System.debug('Value of OpportunityId: '+acId);
for(PartnerNetworkConnection network : connMap) {
String cid = network.Id;
String status = network.ConnectionStatus;
String connName = network.ConnectionName;
String AssignedBusinessUnit = Opp.Assigned_Business_Unit__c;
System.debug('Connectin Details.......Cid:::'+cid+'Status:::'+Status+'ConnName:::'+connName+','+AssignedBusinessUnit);
if(AssignedBusinessUnit!=Null && (AssignedBusinessUnit.equalsIgnoreCase('IT') || AssignedBusinessUnit.equalsIgnoreCase('Proservia'))) {
// Send account to IT instance
PartnerNetworkRecordConnection newAccount = new PartnerNetworkRecordConnection();
newAccount.ConnectionId = cid;
newAccount.LocalRecordId = Opp.AccountId;
newAccount.SendClosedTasks = true;
newAccount.SendOpenTasks = true;
newAccount.SendEmails = true;
newAccount.RelatedRecords = 'Contact';
System.debug('Inserting New Record'+newAccount);
insert newAccount;
// Send opportunity to IT instance
PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
newrecord.ConnectionId = cid;
newrecord.LocalRecordId = acId;
newrecord.SendClosedTasks = true;
newrecord.SendOpenTasks = true;
newrecord.SendEmails = true;
//newrecord.ParentRecordId = Opp.AccountId;
System.debug('Inserting New Record'+newrecord);
insert newrecord;
}
}
}
}
newrecord.RelatedRecords = 'Contact,Opportunity'; //etc