Typo3 Indexed Search Local_Lang path - typo3

i am wondering what TS code is needed to set path to my own indexed search local_lang.
I changed what i needed in pi1/local_lang but i would like to set it to my own so i can have the edited (Croatian in this case) for future projects.
Something like:
plugin.tx_indexedsearch.templateFile = fileadmin/search_temp.html
but for Local_lang of it?

with this lines you can overwrite individual translations:
plugin.tx_myPlugin_pi1._LOCAL_LANG.de.key = value;
plugin.tx_myPlugin_pi1._LOCAL_LANG.en.key = value;
I think that not all extensions supports a complete own localLang file, but not 100% sure.

You could add your translation to the official Translation Server . So your translation will be available trough the Translation Modul in TYPO3 Backend.
The croation translation for indexed_search is managed there: http://translation.typo3.org/hr/TYPO3.TYPO3.core.indexed_search/
There is a single-sign-on with typo3.org implemented. So you need an account on typo3.org first.

Related

How can I find and edit/delete links from a Word document before JS requirement set 1.4?

I'm developing a MS Word Add-In using the JS API. Currently, I need to find and edit or delete specific links inside the entire document. I know that this works using context.document.body.fields and then item.result.delete() and item.result.insertText('new text', 'Replace'). But context.document.body.fields is only available in the latest versions of Word (technically since requirement set 1.4).
I just want to know, are there alternative ways to do this in older Word versions before rs 1.4? And if so, what are those?
I think you can use document.body.search() method to find the hyperlink and this method will return a Range object, you can futher call something like InsertText() to replace it or call range.hyperlink = "" to remove the hyperlink.

Is there any way to add changes of record in frontend visible in typo3 be history?

I have frontend controller which can edit record in database. I want to know if there is any way to add information about that changes in typo3 backend history?
I tried to use typo3/cms/typo3/sysext/backend/Classes/History/RecordHistory.php
I checked too how typo3/cms/typo3/sysext/core/Classes/DataHandling/DataHandler.php set it up but that was over complicated to do in frontend
Thanks for any help!
in TYPO3 V10 you can use this extension to make this easy. you just need to implement the interface provided by this extension with your Domain Models to make then trackable by history.
https://extensions.typo3.org/extension/fe_data_history/
Take a look at Packages/TYPO3.CMS/typo3/sysext/core/Classes/DataHandling/History/RecordHistoryStore.php:
you can use something similar when you are doing your edit operations.
First, create your own copy of the store as the class is internal and adjust it to your needs, then you can do something like:
$store = GeneralUtility::makeInstance(
RecordHistoryStore::class,
# or USER_FRONTEND depending on your use case
RecordHistoryStore::USER_ANONYMOUS
);
$store->addRecord($table, $uid, $payload);

How to generate and resolve custom URLs with TYPO3 9.5

Am using $GLOBALS['TSFE']->cObj->typoLink to generate a link and I've an additional parameter like this: ext__pluginname[d64]=31511 and would like to return something like a/b/c. I would then want TYPO3 to give me back the link so I can resolve it when clicked. I've already tried PersistedAliasMapper but won't allow to return anything with a slash in it. I've even tried a custom aspect mapper. I get the error:
Parameter "tx_ext__pluginname__d64" for route "enhancer_tx_ext__pluginname000000003e62d21a000000000514759a" must match "[^/]++" ("a/c" given) to generate a corresponding URL.
Am able to generate and resolve the slugs(urls). I can store them in db and retrieve them for that matter. No problem.
Am generating them from root page (uid 1).
How can i get this to work?
I assume you already have created the desired path in a database table or view already, making use of the slug feature in the TYPO3 backend or creating it yourself.
You could then use the PersistedAliasMapper in your site config (config/sites/default/config.yaml).
If you need multiple values in a single path divided by slashes (not a combined slug field), take a look at the route configuration for the news extension. You just have to use database mappers instead of static ones, but keep in mind this may impact the performance of the routing!
As you did not provide much detail about your use case, I don't really understand why you need such a path structure with slashes.

TYPO3 - Realurl default Settings overwrite?

How can I overwrite the default settings of the TYPO3 extension realurl with my own extension?
this dont work:
// RealUrl Config File
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['realurl']['configFile'])
|| empty(trim($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['realurl']['configFile']))
) {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['realurl']['configFile'] = 'typo3conf/ext/xxx/Resources/Private/Hooks/realurl_conf.php';
}
How can I use this?
Probably the problem is that realurl is inialized and executed very early (it's the first process which needs to translate the speaking url to url parameter which decide which page and which plugin is rendered).
Your attempt to modify the assignment which is done normaly in typo3conf/LocalConfiguration.php could not be attached to that file as it is just an array, which gets written anew automatically every now and then.
You might add that to typo3conf/AdditionalConfiguration.php.
But why don't you request an admin to assign the path to the config-file in your extension in the realurl EM-config by hand?

Display an older version of a CQ page

For audit purposes I got the requirment to create a tool where the authors can look at older versions of a CQ page. I managed to get the available versions with the JCR VersionManager using the following code (used in a SlingServlet with cq:Page as the resourceType):
Session session = request.getResourceResolver().adaptTo(Session.class);
VersionManager vm = session.getWorkspace().getVersionManager();
VersionHistory versionHistory = vm.getVersionHistory(request.getResource().getPath());
VersionIterator vIt = versionHistory.getAllVersions();
while (vIt.hasNext()) {
Version version = vIt.nextVersion();
String no = version.getName();
Calendar createdDate = version.getCreated();
// do something with it
}
The path of the version points to e.g. /jcr:system/jcr:versionStorage/d6/23/4f/d6234f36-3360-4024-bee2-411020ac63ae/1.0 where I can see a child node called jcr:frozenNode which seems to represent the jcr:content node of this specific version.
How can I tell CQ to render the page in this version? I would expect an url with some parameter or selector, but I didn't find any documentation. I tried to reverse engineer it with the Timewarp, but there the URL seems to be still the original and the magic is hidden somewhere.
I was also in contact with adobe support regarding this, and beside the timewarp there seems to be no built in feature to achieve this. Nevertheless I did some experimenting and found a feasible workaround. Though it might not be easy for a complex layout with many fixed components in the template, luckily on our case we mainly have a parsys.
So my solution is the following: I load the older version through two selectors in the url:
I called it "versionhistory" which is used to take another rendering script called versionhistory.jsp on the page component.
contains the actual version/node name (replacing "." with "_" to not add more selectors
In my versionhistory.jsp I just add the correct path for the parsys component (taking the example path from the question), and include the same layout elements as in the default script e.g. page.jsp:
<cq:include path="/jcr:system/jcr:versionStorage/d6/23/4f/d6234f36-3360-4024-bee2-411020ac63ae/1.0/jcr:frozenNode/par" resourceType="foundation/components/parsys" />