TYPO3, Realurl, News and mutilanguage - typo3

I have a TYPO3 multilanguage site, and I am trying to configure Realurl and
News. Question is: for single/detailed News urls, how do I get both
speaking and language localized versions?
I mean, I am able to get:
localhost/it/paginaSingola/news/detail/News/titolo-singolo
localhost/en/singlePage/news/detail/News/single-title
but I wish something like:
all italian >> localhost/it/paginaSingola/notizie/singola/Notizie/titolo-singolo
all english >> localhost/en/singlePage/news/detail/News/single-title
I am not even sure whether it is a Realurl or a News issue.
In the former case, do I need to define valueMap for postVarSets? How
do I do that?
TYPO3 6.2.13
News 3.2.2
Realurl 1.13.4
sr_language_menu 6.0.7
cheers
mario

This is not possible with realurl 1.x but it can be changed in realurl 2.x. You can write a feature request here: https://github.com/dmitryd/typo3-realurl/issues
RealURL 2.0 is expected to arrive to TER soon. It is already operational except for mount point support and BE module. BE module is in the active development right now.
Edit (March 01, 2016): this is now possible with RealURL 2.x. Basically you create a copy of your configuration and give it another name. Normally you have _DEFAULT, now you do something like _lang1. Than you use _DOMAINS to say that your L=1 should use _lang1:
'_DOMAINS' => array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => 0,
'useConfiguration' => '_DEFAULT',
),
array(
'GETvar' => 'L',
'value' => 1,
'useConfiguration' => '_lang1',
)
),
In your _lang1 you define a different prefix for a postVarSet.
That's all.

I'd be surprised if you didn't figure it out by the bottom of this: https://docs.typo3.org/typo3cms/extensions/news/3.0.0/Main/Administration/Realurl/Index.html

Related

TYPO3 - TCA Migrations - Informational or ToDo?

I'm a newbie in typo3. A friend of me asked, if I can upgrade his installation for him, because I'm a developer. So I checked if I can do it.
I did several steps to upgrade the installation from 7.6.9 to 8.7.3. Now I ended in the installation tool in the section important actions. There is a point TCA migrations.
There it says:
TCA migrations need to be applied Check the following list and apply
needed changes.
The icon path of wizard "link" from TCA table
"tx_myredirects_domain_model_redirect['columns']['destination']['config']['wizards']['link']['icon']"has
been migrated to
tx_myredirects_domain_model_redirect['columns']['destination']['config']['wizards']['link']['icon']"
= 'actions-wizard-link'. ...
Is this just informational or do I have to modify something in the things listed?
Sorry again, if this is a newbie question, but I am actually a newbie in typo3.
If the extensions that need to migrate the TCAs haven't been created by you, then no, you do not really need to change them. The author of the extension should do it, because if you change them and then the author releases an update, then all your changes will be lost.
If the extension is a custom extension, then it would be better to migrate them. Then you can avoid bugs and unwanted disfunctions.
If you have a sitepackage, you can override the TCA's and give them new definitions. This way, if the author releases an update, your TCAs won't be lost. In order to do that, you can follow these instructions:
Extending TCAs
An example would be:
your_sitepackage/Configuration/TCA/Overrides/tx_tablename_domain_model_modelname
$GLOBALS['TCA']['tx_tablename_domain_model_modelname']['columns']['columnYouNeedToChange'] = [
'label' => 'input_29 link',
'config' => [
'type' => 'input',
'wizards' => [
'link' => [
'type' => 'popup',
'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel',
'icon' => 'actions-wizard-link',
'module' => [
'name' => 'wizard_link',
],
'JSopenParams' => 'height=800,width=600,status=0,menubar=0,scrollbars=1',
'params' => [
'blindLinkOptions' => 'folder',
'blindLinkFields' => 'class, target',
'allowedExtensions' => 'jpg',
],
],
],
]
This for example would solve the first problem of the image you shared. You just need to replace the table name. (That's TYPO3v8. TYPO3 v9 has more changes when it comes to TCAs)
If you are not sure how the path to the column look like ($GLOBALS['TCA']['tx_tablename_domain_model_modelname']['columns']['columnYouNeedToChange']) then follow this:
TCA Paths
#Thomas Löffler is right. It would be very useful to create an issue on GitHub and let the author know that some changes need to be made.
Best regards
This will show which TCA fields have been identified to have a legacy format and have been transformed while loading the configuration files.
While it is good practice to do these changes and keep this clean, strictly speaking it is not required.
Tip: I would rather look there before an upgrade because deprecated stuff might still have an upgrade path in an older version but none in the newest.

How to manage different versions of application by using plugins in cakephp 3?

I have a single cakephp 3 application
I have a generic view which render data depending of an array struture of fields configured in each Model, this array includes configurations for display each field in the view like (text titles, maxsize, sortable, etc..) and database configuration like (column name in the database/table, datatype, etc..) in the same array, and its working fine.
public $tableData = [
[
'name' => 'Table1.name',
'title' => 'Name',
'field' => 'name',
'sortable' => true,
'type' => 'string',
'size' => '50px',
],
[
'name' => 'Asosiation1.option',
'title' => 'Topic',
'field' => 'topic_option',
'sortable' => true,
'type' => 'string',
'size' => '150px',
],
... More fields and asosiations
]
But now, i need to have these same Models in different versions, because the structure of the database/table for each Model change every year, but i need to preserv/show the data corresponding to each version as it is.
So if a user request mySite.com/2010, Site must show data using Model array structure defined for that year especifically.
So, i created:
/plugins/Years/version2010
/plugins/Years/version2011
etc..
and in each pluging, I copied all Models changing only the namespace, defaultConnectionName (1 schema per Year) and array structure.
This provokes to have mutiple plugins loaded in bootstrap config.
Is there any way to load only the necesary plugin depending of the request ?(/2010, /2011, etc..)
Ex. In bootstrap.php I do for each plugin year:
Plugin::load('Years/version201X', ['bootstrap' => false, 'routes' => true]);
also
Is there any way to avoid having to specify the plugin name every time i do loadModel() or TableRegistry::get() ?
Ex. In main App GeneralController I have to do every time:
$this->loadModel('Years/version201X/Table1');
Or maybe there is another better approach to solve this situation i havent seen
Is there any way to load only the necesary plugin depending of the
request ?(/2010, /2011, etc.
Yes. Inside config/bootstrap.php you can check the request uri and then have a switch statement for the plugins. Something like this:
$uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_SPECIAL_CHARS);
// might need explode('/', $uri); to extract the right URL component
switch ($uri) {
case '2011':
// load plugin
break;
case '2012':
// log plugin
break;
}
You probably dont even need the switch statement, be creative there. Obviously thats not exact, but if gives you the right idea.
Is there any way to avoid having to specify the plugin name every time
i do loadModel() or TableRegistry::get() ?
If the model is unique to the plugin then I am not sure how you get away with this. Whats the problem though? Just a few extra characters. Sounds like you only have to do this once per year, right? However, you might not have to specify that if you're within the scope of the plugin. I am not sure on that, but its worth trying.

Typo3 Realurl urlcache is messed up by gclid-parameter

We use Google-Adwords for some campaigns which ads a gclid=xxxxx parameter to the URL.
Unfortunately, this messes up the RealUrl tables and when the page is called next time it results in a 404-error.
Is there any way to make RealUrl ignore this particular parameter?
This is claimed to be solved on GitHub:
https://github.com/dmitryd/typo3-realurl/issues/377
Anyways I still had that problem that the gclid triggers a urldata entry which causes a redirect loop. For now I solved it with removing the gclid from the ignoredGetparameters Filter and then banning it:
'cache' => array( // removed gclid from the filter, then ban it
'ignoredGetParametersRegExp' => '/^(?:utm_[a-z]+|pk_campaign|pk_kwd|TSFE_ADMIN_PANEL.*)$/'
'banUrlsRegExp' => '/gclid|tx_solr|tx_indexed_search|(?:^|\?|&)q=/',
),
Go to the Install Tool and add the parameter to [FE][cHashExcludedParameters].
Since realurl 2, there is a new possibility to control entries to tx_realurl_urldata:
https://github.com/dmitryd/typo3-realurl/wiki/Configuration-reference#banurlsregexp
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
//[...]
'cache' => array(
'banUrlsRegExp' => '/gclid|tx_solr|tx_indexed_search|(?:^|\?|&)q=/'
),
//[...]
Works like a charm, didn't knew until today this option even exists.

TYPO3 new record appearing on wrong location in Backend List

I'm developing a new extension using ExtBase in TYPO3 (4.7) for a client.
I have however the strangest problem. In the back-end, my possible, new record types are - as usual - listed in the Insert new record Backend List. Usually each of these record-types are preceded by the module name (actually they are grouped right after the module name).. However, in my case, 1 or 2 of the record-types of any other extension appear within my extension's list as well.. I've been trying to figure out pretty much all that I can, I even copied the extension over to an entirely different TYPO3 installation, but the same problem persists..
If of any extension some records appear just below my extension's title, and I delete that particular extension, just some other record-types appear of another extension.
What's going on here??
Short & late answer:
i guess you have defined the title of your models in two different ways or with a non-existent languagefile in your ext_tables.php. Something like this:
Model1:
$TCA['tx_aaext_domain_model_one'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:bn_news/Resources/Private/Language/locallang_db.xml:tx_bnnews_domain_model_categories',
Model2:
$TCA['tx_aaext_domain_model_two'] = array(
'ctrl' => array(
'title' => 'Static Title',
and/or your extension-name has an underscore like aa_extension, then this error can happen.
Make sure that both title-definitions are dynamic and begin with "LLL:EXT:" and point to an existing translation. Everything should be fine now.
Long answer will be to long :)

How to use Zend_Loader_Autoloader

I think this is a reasonably easy question however I just don't get autoloading in Zend framework.
Basically, I have the standard Zend project layout with application/models, application/controllers, application/views directories. I have also added an application/forms directory, and the classes that it contains will be named Application_Form_*
How do I register the new directory with the autoloader?
Thanks...
Kim
You don't need to register the new directory with the autoloader. If you create a form it should look something like like this:-
application/forms/Myform.php
class Application_Form_Myform extends Zend_Form
{
public function init()
{
//Put your code here
}
}
You can then instantiate your form like this (in your controller for example):-
$myform = new Application_Form_Myform();
Zend Framework will then autoload the class for you.
http://framework.zend.com/manual/en/learning.quickstart.create-form.html
There is an explanation of Autoloading in Zend Framework in the manual.
An extract from that:-
Zend Framework has borrowed an idea from » PEAR, whereby class names have a 1:1 relationship with the filesystem. Simply put, the underscore character ("_") is replaced by a directory separator in order to resolve the path to the file, and then the suffix ".php" is added. For example, the class "Foo_Bar_Baz" would correspond to "Foo/Bar/Baz.php" on the filesystem. The assumption is also that the classes may be resolved via PHP's include_path setting, which allows both include() and require() to find the filename via a relative path lookup on the include_path.
Which basically means that folders don't all need to be registered in the autoloader. It can quite happily find files in folders anywhere under the application or library/Zend folders so long as you follow the naming convention and proper casing.
The default folders under application/ that end with an 's' are special cases specifically dealt with in Zend_Application_Module_Autoloader::initDefaultResourceTypes() and should not be confused with the main autoloading mechanism.
Use $resourceLoader:
$resourceLoader->addResourceTypes(array(
'acl' => array(
'path' => 'acls/',
'namespace' => 'Acl',
),
'form' => array(
'path' => 'forms/',
'namespace' => 'Form',
),
'model' => array(
'path' => 'models/',
'namespace' => 'Model',
),
));
See: http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html