<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Nette Framework forum : Uživatelé Nette Framework : Latte : zmenit default sablon na /theme/ v root-e</title>
<link>https://forum.nette.org/cs</link>
<description>Nette Framework forum</description>
<language>cs</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>zmenit default sablon na /theme/ v root-e (Latte)</title>
	<dc:creator>Šaman</dc:creator>
	<link>https://forum.nette.org/cs/36643#p227577</link>
	<guid isPermaLink="false">227577@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Čistě pro kompatibilitu to ještě merguju s původními cestami. Pokud by
nějaký modul používal běžnou konvenci, ale také by dědil z
&lt;code&gt;app/BasePresenter&lt;/code&gt;.&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;// BasePresenter.php
public function formatTemplateFiles(): array
{
	$name = $this-&amp;gt;getName();
	$presenter = substr($name, strrpos(&apos;:&apos; . $name, &apos;:&apos;));
	$dir = dirname($this-&amp;gt;getReflection()-&amp;gt;getFileName());
	$templateFiles = [
		&quot;$dir/$this-&amp;gt;view.latte&quot;,
		&quot;$dir/templates/$this-&amp;gt;view.latte&quot;
	];

	$originalTemplateFiles = parent::formatTemplateFiles();
	return array_merge($templateFiles, $originalTemplateFiles);
}&lt;/code&gt;&lt;/pre&gt;
</description>
	<pubDate>Wed, 11 Sep 2024 20:18:53 +0200</pubDate>
</item>
<item>
	<title>zmenit default sablon na /theme/ v root-e (Latte)</title>
	<dc:creator>Martin Dřímal</dc:creator>
	<link>https://forum.nette.org/cs/36643#p227575</link>
	<guid isPermaLink="false">227575@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Obě ty funkce vrací pole možných cest k šablonám, ve výchozím stavu
např. formatLayoutTemplateFiles() vrátí:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;array(4) {
  [0]=&amp;gt;
  string(81) &quot;/var/www/..../web/app/FrontendModule/templates/Home/@layout.latte&quot;
  [1]=&amp;gt;
  string(81) &quot;/var/www/..../web/app/FrontendModule/templates/Home.@layout.latte&quot;
  [2]=&amp;gt;
  string(76) &quot;/var/www/..../web/app/FrontendModule/templates/@layout.latte&quot;
  [3]=&amp;gt;
  string(61) &quot;/var/www/.../web/app/templates/@layout.latte&quot;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Takže když si to v base presenteru přepíšeš na&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;public function formatLayoutTemplateFiles(): array
{
	$layout_templates = [
        &apos;/nejaka/jina/cesta/k/@layoutu.latte&apos;,
        &apos;/taky/muze/byt/i/jinde/@layout.latte&apos;,
    ];
	return $layout_templates;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Tak to bude hledat layout v těch tvých cestách a použije se první
nalezená šablona. S formatTemplateFiles to stejné (stačí nakouknout na tu
původní a upravit si ji). V některých projektech mám cesty i dynamické
(jeden admin pro více webů, uživatelem přepínatelné šablony, atd..)&lt;/p&gt;
</description>
	<pubDate>Wed, 11 Sep 2024 19:17:26 +0200</pubDate>
</item>
<item>
	<title>zmenit default sablon na /theme/ v root-e (Latte)</title>
	<dc:creator>pn-pm</dc:creator>
	<link>https://forum.nette.org/cs/36643#p227574</link>
	<guid isPermaLink="false">227574@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;Martin Dřímal napsal(a):&lt;/p&gt;

	&lt;p&gt;V (base)presenteru můžeš přepsat funkce
	&lt;code&gt;formatLayoutTemplateFiles()&lt;/code&gt; a
	&lt;code&gt;formatTemplateFiles()&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;googlim, googlim, stale nevidim :D&lt;br&gt;
nasmerujes prosim ?&lt;/p&gt;
</description>
	<pubDate>Wed, 11 Sep 2024 17:50:31 +0200</pubDate>
</item>
<item>
	<title>zmenit default sablon na /theme/ v root-e (Latte)</title>
	<dc:creator>Martin Dřímal</dc:creator>
	<link>https://forum.nette.org/cs/36643#p227573</link>
	<guid isPermaLink="false">227573@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;V (base)presenteru můžeš přepsat funkce
&lt;code&gt;formatLayoutTemplateFiles()&lt;/code&gt; a
&lt;code&gt;formatTemplateFiles()&lt;/code&gt;&lt;/p&gt;
</description>
	<pubDate>Wed, 11 Sep 2024 16:28:10 +0200</pubDate>
</item>
<item>
	<title>zmenit default sablon na /theme/ v root-e (Latte)</title>
	<dc:creator>pn-pm</dc:creator>
	<link>https://forum.nette.org/cs/36643#p227570</link>
	<guid isPermaLink="false">227570@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;viem ze sa da nastavit v presenteri layout prikazom&lt;/p&gt;

&lt;pre class=&quot;language-php&quot;&gt;&lt;code&gt;$this-&amp;gt;setLayout( $LayoutPath );&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;ale jak nastavit cestu, aby layout aj template pre actions hladalo VSETKY
v roote v adresari theme ? Prezenter by som nechal napr /app/UI/Home, ale temy
chcem dat vyssie aby ich lahsie nasiel aj menej zbehly grafik…&lt;/p&gt;

&lt;p&gt;ako na to aby som mohol mat latecko v roote? Nejaky zapis do config.neon,
alebo vytvorit nejak vlastny TemplateFactory class?&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;/theme/@layout.latte
/theme/Home/default.latte
/theme/   ... atd ...&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;mam v plane tam napr aj ukladat nekompilovane scss atd a bolo by fajn mat to
v roote pokope&lt;/p&gt;
</description>
	<pubDate>Wed, 11 Sep 2024 14:49:38 +0200</pubDate>
</item>
</channel>
</rss>
