Indexed Search Crawler Configuration - Typo3 6.2 - typo3

I've a custom database table. I want to index the records of the table by
language specific. I've created a crawler configuration named "customindex"
and created a Indexer Configuration named "Data Indexer".
In my website, there are two languages: 0 - Deutch (Default) and 1- English.
But in frontend I can see both Deutch and English records in default
language search. I've investigated with this and I saw a
configuration "tx_crawler.crawlerCfg". (
http://docs.typo3.org/typo3cms/extensions/crawler/ExtCrawler/Configuration/PageTsconfigReference(txCrawlercrawlercfg)/Index.html).
And I don't understand the key parameter here "paramSets.[key]". What is
the "key" actually indicated here? Is it extension key or crawler
configuration name?
I wrote a Page TS config like this;
tx_crawler.crawlerCfg.paramSets.key =
&tx_myext_myext[uid]=[_TABLE:tx_myext;_PID:22;_WHERE:AND
(sys_language_uid=0)]
tx_crawler.crawlerCfg.paramSets.key {
baseUrl = http://www.example.com/
cHash = 1
pidsOnly = 22
procInstrFilter = tx_indexedsearch_reindex
}
# A second tx_tour configuration for another language with language ID 1
tx_crawler.crawlerCfg.paramSets.key =
&tx_myext_myext[uid]=[_TABLE:tx_myext;_PID:22;_WHERE:AND
(sys_language_uid=1)]&L=1
tx_crawler.crawlerCfg.paramSets.key {
baseUrl = http://www.example.com/
cHash = 1
pidsOnly = 22
procInstrFilter = tx_indexedsearch_reindex
}
But I don't know what is that "key" (tx_crawler.crawlerCfg.paramSets.key)
indicated here.
Can you guys please help me to find what is that "key" here?

"Key" will be any variable name we need to use as crawler configuration.

Related

How to use Sitename in Constants as a default value in TYPO3?

I want to set the Sitename in Constants by default, so I can use this settings.variable in my Fluidtemplate.
I found in another post here on stackoverflow:
DB:sys_template|1|title
GLOBAL:TYPO3_CONF_VARS|SYS|sitename
But if I use this in my constants.ts like this:
# cat=plugin.tx_rmnavigation/01_NaviSettings/a; type=string; label=testing sitetitle
testsitetitle = DB:sys_template|1|title
OR
# cat=plugin.tx_rmnavigation/01_NaviSettings/a; type=string; label=testing sitetitle
testsitetitle = GLOBAL:TYPO3_CONF_VARS|SYS|sitename
AND in my setup.ts:
testsitetitle = {$plugin.tx_rmnavigation.settings.testsitetitle}
I get only the text not the value of the "variable" see this picture Constant Editor...
How can I use the Sitename in Constants as a defaultvalue?
Edit
I forgot to say, perhaps it's important for this issue, I try this here in both files:
plugin.tx_rmnavigation {
settings {
..
}
}
You have to assign your constant to a content object's data property (see https://docs.typo3.org/typo3cms/TyposcriptReference/8.7/ContentObjects/Index.html and https://docs.typo3.org/typo3cms/TyposcriptReference/8.7/Functions/Stdwrap/Index.html#data) to get it resolved:
testsitetitle = TEXT
testsitetitle.data = {$plugin.tx_rmnavigation.settings.testsitetitle}
And I would prefer your second variant for the constant definition because it uses the value from the current template record:
# cat=plugin.tx_rmnavigation/01_NaviSettings/a; type=string; label=testing sitetitle
testsitetitle = GLOBAL:TYPO3_CONF_VARS|SYS|sitename
But the first one should also work if you use colons instead of pipes:
testsitetitle = DB:sys_template:1:title
If you have a multi domain page the query to DB:sys_template:1:sitetitle might not work, as the 1 is the UID, not the PID of the root node of your template. But TSFE to the rescue!
In the context of your page call, the TSFE already has the sitetitle from the backend template loaded.
If you for example want to output a og:site_name, you can access the value by using:
og:site_name = TEXT
og:site_name {
data = TSFE:tmpl|sitetitle
attribute = property
}
This way no additional database queries are needed and it will work on multi domain, multi root node pages.
Thanks for your suggestions. I found a solution with your infos.
Honestly I think this doesn't works in Constants, because the both methods are readonly.
So I found a working solution for my Issue: I need that Variable only for read in my Templates, so I create a new Typoscript File libs.ts and included this with:
# Include Libraries
<INCLUDE_TYPOSCRIPT: source="FILE: EXT:rm_navigation/Resources/Private/TypoScript/libs.ts">
in the /Configuration/TypoScript/setup.ts File.
The content of libs.ts is:
TSFE-Syntax
lib.sitename = TEXT
lib.sitename.data = GLOBAL:TYPO3_CONF_VARS|SYS|sitename
OR
DB-Syntax
lib.sitename = TEXT
lib.sitename.data = DB:sys_template:1:sitetitle
works both. I read that you use the colon-syntax for DB usage and the pipe-syntax for Global Variables.
To get this to Fluid use this Code:
<f:cObject typoscriptObjectPath="lib.sitename" />
I hope it helps Others who also has this Issue.

RealURL with GET parameters

We have developed a typo3 plug in that searches for trucks. For SEO reasons, we are trying to use the realURL plug in to make the URLs friendlier to use.
On the front page we have several call to actions that link to the search page with certain search parameters. An example is bellow:
/search-results/?tx_fds_searchresults[type_name]=Trailer
This link works as expected. On the results page is a link to the listings page with more details. An example is bellow:
/listing/?tx_fds_listing[id]=119870
This link is not working. tx_fds_listing[id] is not being populated in the arguments passed to the plug in controller.
At first we thought it might be a config issue but again, it isn't present on other pages.
The ID is not a database object and may be a text string instead.
Edit:
I should add that it works fine with RealURL turned off.
We get the id as $id = $this->request->getArgument('id');
Edit 2:
Here is the error message from the logs.
[ALERT] request="28233e225150a" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 201512141630381db91bba - {"exception":"exception 'TYPO3\\CMS\\Extbase\\Mvc\\Exception\\NoSuchArgumentException' with message 'An argument \"id\" does not exist for this request.'
I also tried renaming the variable to name, but that didn't work either.
I have a solution that solves the root cause of the problem, if not the specific issue.
So I had to add additional mapping to the realurl_conf.php file. For example to get the listing id:
$config['domain.com']['postVarSets'][3]['stock'] = array(array('GETvar' => 'tx_fds_listing[id]'));
This makes the effective URL:
/listing/stock/119870
This was the intended usage for the plugin, so this is a good result. I also added configuration for ajax and pdfs. This required modification to the typoscript that was not obvious.
PDF TS:
pdf = PAGE
pdf {
typeNum = 300
10 = USER_INT
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
#vendorName = TYPO3
extensionName = Fds
pluginName = Listing
#controller = FDS
controller = Tx_Fds_Controller_FDSController
#action = listingPdf
switchableControllerActions.FDS.1 = listingPdf
}
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/pdf
xhtml_cleaning = 0
admPanel = 0
}
}
PDF RealURL Config:
$config['domain.com']['postVarSets'][3]['pdf'] = array('type' => 'single', 'keyValues' => array ('type' => 300));
PDF effective URL:
/listing/pdf/stock/119870

XML sitemap which includes tt_news articles

Currently I'm using mc_googlesitemap. I've read that I can include tt_news articles in the xml output when using "Google Sitemap for Contents". In the documentation you have an option Table where the contents live but this is not available for me. I only can choose "Google Sitemap for Contents" and than I have "Selected Pages". There are no such option as seen in the docu and as described here.
I'm using Typo3 4.7.10 and mc_googlesitemap 0.4.2.
I also tried weeaar_googlesitemap but here in the xml output I only see the page itself where the plugin was configured to display its output. Accessing Web -> GoogleSitemap doesn't work because of the deprecated function
Fatal error: Call to undefined method t3lib_div::fixed_lgd_pre() in
/usr/home/xxx/typo3conf/ext/weeaar_googlesitemap/mod1/index.php
on line 121
I found this fix but currently I cannot adapt the source files because I've no permissions.
How do I get an xml sitemap which can also display me tt_news articles of a certain category?
Edit:
I fixed the deprecated warning and my TS looks like the following (for the weaar sitemap):
#############################
# Sitemap
#############################
sitemap = PAGE
sitemap {
typeNum = 200
10 >
10 < plugin.tx_weeaargooglesitemap_pi1
10.pid_list = 1
10.recursive = 0
10.allowedDoktypes = 2,1,4
10.domain = http://www.domain.com/
10.tt_news.single_page {
1 = 78
1.pid_list = 77
}
10.tt_news {
disabledParameter = day,month,year
}
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
I have the following problems:
Hidden Pages are shown in my sitemap.xml (there is no page with doktype 5 allowed)
tt_news articles are not displayed (what is wrong with my configuration?)
Explanation:
10.pid_list = 1 // this is my main entry point
10.tt_news.single_page.1 = 78 // this is my page id where the single view of tt_news resides
10.tt_news.single_page.1.pid_list = 77 // this is my sysfolder where the news are placed
What I'm doing wrong? Alternatives?
There is an extension called tq_seo which does all the SEO magic for your TYPO3 site. It's quite easy but also powerful.

Get typoscript values in extbase framework

I am new to extbase(MVC) Framework , How can we get typoscript values in our extension :
Eg : suppose if i have some typoscript values like:
plugin.tx_some-extname.somevlaueX = XXXX
plugin.tx_some-extname.somevlaueY = yyyy
plugin.tx_some-extname.somevlaueZ = zzzz
how will i get these values in a specific action of our controller .I hope this makes sense ??
Declare values in the settings scope (in the setup field) ie:
plugin.tx_some-extname.settings {
myXsetting = XXXX
}
So the all settings will be accesible in your plugin in $this->settings (as array) :
$valX = $this->settings['myXsetting'];
In TYPO3-7.6 + the whole TypoScript for an extension can be retrieved with
$typoScript = $this->configurationManager->getConfiguration( $this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK);
where for the 1st parameter exist 3 different options:
$this->configurationManager::CONFIGURATION_TYPE_SETTINGS
$this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK
$this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT
optional for the function $this->configurationManager->getConfiguration() the extension-key can be given as 2nd parameter and the plugin-name as 3rd parameter. So the whole command looks like this:
$typoScript = $this->configurationManager->getConfiguration( $this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK, $extensionKey, $pluginName );
Consider that the static template has to be included in the backend-template to return the desired output.
ConfigurationManager is an instance of
TYPO3\CMS\Extbase\Configuration\ConfigurationManager

Zend Implementing SEO friendly or vanity URLs with router

I have a simple e-commerce web application with product URL's like:
http://www.example.com/product/view/product_id/15
where "Product" is the controller and "view" is the action in the Product Controller
How do I change this URL to show up as:
http://www.example.com/product/view/product_name/iphone-4S-16-gb
where product_id "15" is the primary key in the product table and product_name has the value "iphone 4s 16 gb" without the hyphens
What is the simplest way for me to make this change.
Would really appreciate your help.
Thanks a lot.
resources.router.routes.view-article.type = "Zend_Controller_Router_Route_Regex"
resources.router.routes.view-article.route = "articles/(?!archive)([a-zA-Z\-]+)/(\d+)(?:/(.*))?"
resources.router.routes.view-article.reverse = "articles/%s/%d/%s"
resources.router.routes.view-article.defaults.module = "articles"
resources.router.routes.view-article.defaults.controller = "view"
resources.router.routes.view-article.defaults.action = "view-article"
resources.router.routes.view-article.map.1 = topicSlug
resources.router.routes.view-article.defaults.topicSlug = topicSlug
resources.router.routes.view-article.map.2 = id
resources.router.routes.view-article.defaults.id = 0
resources.router.routes.view-article.map.3 = articleSlug
resources.router.routes.view-article.defaults.articleSlug = articleSlug
links like http://example.com/articles/circus/616/4-marta-vse-za-ruletkami
http://example.com/products/category/product_id/product_name
EDIT 1
this is a setup for default router plugin. shown as articles from my blog module, but easily updates for shop.
parts - http://example.com/ is host :) articles/circus/ => module and controller mapeed.
resources.router.routes.view-article.map.1 = topicSlug is a category. for shop.
616/4-marta-vse-za-ruletkami ID and any slug. product description, for example, 'iphone-4S-16-gb
'
defaults are in config.
another example /{maps2module}/{maps2topicSlug}/{maps2id}/{maps2articleSlug}