1、Introduction
之前写过一篇文章:Mysql主从同步的原理。
相信看过这篇文章的童鞋,都摩拳擦掌,跃跃一试了吧?
今天我们就来一次mysql主从同步实战! (continue reading…)
1、Introduction
之前写过一篇文章:Mysql主从同步的原理。
相信看过这篇文章的童鞋,都摩拳擦掌,跃跃一试了吧?
今天我们就来一次mysql主从同步实战! (continue reading…)
To add a new type of records to the link browser you have to add a few lines of PageTSconfig to the system. Under TCEMAIN.linkHandler you can add new tabs with unique identifiers. By using the TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler the link browser knows that the new tab cares about some kind of records. It is possible to add custom LinkHandler since TYPO3 7 LTS (see feature RST). Of course you have to configure the table that stores the records. Other than that you have a few additional options:
TCEMAIN.linkHandler.tx_news {
handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
label = News
configuration {
table = tx_news_domain_model_news
storagePid = 164
hidePageTree = 1
}
scanAfter = page
}
label can also be a reference to a locallang file (LLL:EXT:...).hidePageTree is set to 1 the page tree will not be rendered in this link browser tab.storagePid is set this page will be rendered when the tab is opened first.pageTreeMountPoints are set, those are rendered instead of the normal page tree.scanAfter (or scanBefore) option defines the order in which handlers are queried when determining the responsible tab for an existing link.displayAfter (or displayBefore).The 2nd part of the configuration is concerned with the frontend rendering of the links to the records. So let’s have a look at the TypoScript.
With the PageTSconfig from above it is now already possible to add links in a RTE. This will create something like <a href="t3://record?identifier=tx_news&uid=2">News</a> in the database. And when this is rendered in the frontend you need to make sure that TYPO3 knows how to resolve the t3://record?identifier=tx_news link. You tell TYPO3 in its favorite language: TypoScript.
config.recordLinks.tx_news {
typolink {
parameter = {$myConstants.newsDetailPid}
additionalParams.data = field:uid
additionalParams.wrap = &tx_news_pi1[news]=|
useCacheHash = 1
}
}
Under config.recordLinks you have to register the same identifier you used in the PageTSconfig. Of course you need to tell TYPO3 on what page the record should be rendered, how to pass the uid and what other parameter need to be added to the URL. You could add
config.recordLinks.tx_news.forceLink = 1
to force even links to hidden records.
And that is all you have to do.
From: https://usetypo3.com/linkhandler.html
page.headTag.stdWrap.cObject = COA
page.headTag.stdWrap.cObject{
5 = TEXT
5.value = <head>
10 = TEXT
10.value(
xxxx
)
}
page.bodyTagCObject = COA
page.bodyTagCObject{
5 = TEXT
5.value = <body>
10 = TEXT
10.value(
xxxx
)
}
nachdem die Default-Installation ja ein wenig mager in Sachen Verschlüsselung ist, habe ich die Freiheit von Froxlor genutzt, um ein paar Anpassungen vorzunehmen.
/**
* set page title
* @param $title
*/
public static function setPageTitle($title){
GeneralUtility::makeInstance(ObjectManager::class)->get(\TYPO3\CMS\Core\Page\PageRenderer::class)->setTitle($title);
// For the search
$GLOBALS['TSFE']->altPageTitle = $title;
$GLOBALS['TSFE']->indexedDocTitle = $title;
}
xlf:
/** @var $languageFactory LocalizationFactory */
$languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
$LOCAL_LANG = $languageFactory->getParsedData('EXT:sitebase/Resources/Private/Language/locallang.xlf', 'en', 'utf-8');
xml:
public function getTranslate($file, $key, $lang)
{
$xml = GeneralUtility::xml2array(file_get_contents($file));
if (isset($xml['data'][$lang][$key])) {
return $xml['data'][$lang][$key];
} else {
return $xml['data']['default'][$key];
}
}
HOOKS:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase']['currency'] = 'EXT:sitebase/Classes/Hooks/HashHook.php:' . 'Top\\Sitebase\\Hooks\\HashHook->makeHash';
It seems that all ORDER BY will be ignored if they stand in sub-query before GROUP BY in mysql 5.7.
I have the same issue in my query. I found work-around. You can add "ORDER BY" by key column. If id is primary key in your table, you can add
GROUP BY `id`
before
ORDER BY FIELD(lang, 'EN', 'JP')
Query:
`SELECT *
FROM
(
SELECT `id`, `category`, `name`, `number`, `lang`
FROM `test`
WHERE `category` = 'Cat1'
GROUP BY `id`
ORDER BY FIELD(lang, 'EN', 'JP')
) as table
GROUP BY number
ORDER BY number DESC`