Logo
  • NOTES
  • BLOG
  • OSS
  • TALKS
  • WIKI
  • ABOUT
GITHUB

Nette

Status
Not started

CMS

  • https://github.com/nattreid
  • https://github.com/modette
  • https://github.com/voonne
  • https://github.com/dravencms
  • https://github.com/PolywebCZ
  • https://github.com/ThunboltCMS
  • https://github.com/zbycz/npress
  • https://github.com/Ginny/NanoCMS
  • https://github.com/dmvk/cms
  • https://github.com/Mirgen/web_cms
  • https://github.com/occ2
  • https://github.com/netis-cms
  • https://github.com/wakerscz
  • https://github.com/chapcz/admin-sandbox

Latte

ifCurrentIn

{block content}
{ifCurrentIn "Page:default", "Homepage:default"}
    Hello, standart macro
{/ifCurrentIn}


<div n:ifCurrentIn="'Page:default', 'Homepage:default'">
    Hello, n:macro
</div>
{/block}
Logo

© f3l1x

GitHubLinkedInXYouTube
class HomepagePresenter extends BasePresenter
{
    public function templatePrepareFilters($template)
    {
        $template->registerFilter($latte = $this->context->nette->createLatte());
    
        $set = Nette\Latte\Macros\MacroSet::install($latte->getCompiler());
        $set->addMacro('ifCurrentIn', function($node, $writer)
        {
            return $writer->write('foreach (%node.array as $l) { if ($_presenter->isLinkCurrent($l)) { $_c = true; break; }} if (isset($_c)): ');
        }, 'endif; unset($_c);');
    }
}