Created
April 29, 2019 16:06
-
-
Save smichaelsen/bf481c2d58f507fa33ef7752f22c67da to your computer and use it in GitHub Desktop.
Files with code examples of ~mixed~ quality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyVendor\MyExtension\Utility; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
use TYPO3\CMS\Extbase\Utility\LocalizationUtility; | |
/** | |
* Class MediaWallUtility | |
* | |
* @package MyVendor\MyExtension\Utility | |
*/ | |
class CategoryUtility | |
{ | |
public function getCategoryTitleForSearchResults($content = '', $conf) | |
{ | |
$newsId = $this->cObj->data['arguments'][0]; | |
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); | |
/** @var \MyVendor\MyExtension\Domain\Repository\CategoryRepository $categoryRepository */ | |
$categoryRepository = $objectManager->get(\MyVendor\MyExtension\Domain\Repository\CategoryRepository::class); | |
$content = $categoryRepository->getLanguageOverlayTitle($newsId); | |
if ($GLOBALS['TSFE']->sys_language_uid != 0 && $content['overlaytitle']) { | |
return $content['overlaytitle']; | |
} else { | |
return $content['title']; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{namespace v=FluidTYPO3\Vhs\ViewHelpers} | |
<f:if condition="{item}"> | |
<f:then> | |
<a href="index.php?tx_myext_pi1[item]={item.uid}" title="<f:translate key="itemLinkTitle"/>"> | |
{item.title} | |
</a> | |
</f:then> | |
</f:if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment