title = "Ürün Grupları Kategoriler" url = "/urun-gruplari/:slug" layout = "master" is_hidden = 0 contentType = "html" force_show = 0 [viewBag] localeUrl[en] = "/product-groups/:slug" == param("slug"); $lang = LanguageController::GetLang(); $this['getlang'] = $lang; $this['detail'] = Db::table('flatart_products_categories')->where("status", 1)->where("lang", $lang)->where("slug", $slug)->first(); $this['items'] = Db::table('flatart_products_categories')->where("status", 1)->where("lang", $lang)->where("parent", $this['detail']->id)->orderBy("id", "asc")->get(); $this['products'] = Db::table('flatart_products_')->where("status", 1)->where("lang", $lang)->where("category", $this['detail']->id)->orderBy("id", "asc")->get(); $this['hreflang'] = Db::table('flatart_products_categories')->where("status", 1)->where("hreflang", $this['detail']->hreflang)->get(); foreach($this['hreflang'] as $item){ if($item->lang == 'tr'){ $this->page->turkishlink = "/tr/urun-gruplari/".$item->slug."/"; }elseif($item->lang == 'en'){ $this->page->englishlink = "/en/product-groups/".$item->slug."/"; } } if($this['getlang'] == 'en'){ $this->page->meta_title = $this['detail']->meta_title." - Villa Yapı Prefabrik"; $this->page->meta_description = $this['detail']->meta_description; $this->page->canonical = "https://villayapi.com/en/product-groups/".$this['detail']->slug."/"; }else{ $this->page->meta_title = $this['detail']->meta_title." - Villa Yapı Prefabrik"; $this->page->meta_description = $this['detail']->meta_description; $this->page->canonical = "https://villayapi.com/tr/urun-gruplari/".$this['detail']->slug."/"; } $this['subcategories'] = new class { public function get($value) { $lang = LanguageController::GetLang(); $get = Db::table('flatart_products_categories')->where("parent", $value)->orderBy('sort', 'ASC')->where("lang", $lang)->get(); return $get; } }; $this['subcategoryproducts'] = new class { public function get($value) { $lang = LanguageController::GetLang(); $get = Db::table('flatart_products_')->where("category", $value)->orderBy('sort', 'ASC')->where("lang", $lang)->get(); return $get; } }; $this['getcategory'] = new class { public function get($value) { $get = Db::table('flatart_products_categories')->where("id", $value)->first(); return $get; } }; } ?> == {% set breadcount = 1 %}
background

{{ detail.name }}

{% for item in items %} {% endfor %}
{% for subitem in subcategories.get(detail.id) %} {% for item in subcategoryproducts.get(subitem.id) %} {% endfor %} {% endfor %} {% for item in products %} {% endfor %}
{{ detail.content|raw }}