Enhance placeholder functionality: Updated TemplateService to support 'setting' placeholders, allowing dynamic retrieval of settings values. Modified the placeholder picker to include setting types and added localization for new placeholder types in both English and Turkish. Improved site layout by integrating settings for favicon and custom CSS.
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
@php
|
||||
// Setting key'lerini veritabanından al (aktif ve public olanlar)
|
||||
$settingKeys = \App\Models\Setting::where('is_active', true)
|
||||
->where('is_public', true)
|
||||
->orderBy('key')
|
||||
->pluck('key')
|
||||
->toArray();
|
||||
|
||||
// Eğer setting yoksa, yaygın örnekleri kullan
|
||||
if (empty($settingKeys)) {
|
||||
$settingKeys = ['site_name', 'site_description', 'contact_email', 'contact_phone', 'site_url', 'copyright_text', 'seo_meta_title', 'seo_meta_description'];
|
||||
}
|
||||
|
||||
// Desteklenen placeholder tipleri ve açıklamaları
|
||||
$placeholderTypes = [
|
||||
'special' => ['label' => __('placeholder-picker.special_placeholders'), 'examples' => ['page.content', 'page.title', 'page.excerpt', 'menu', 'staticMenu']],
|
||||
'setting' => ['label' => __('placeholder-picker.type_setting'), 'examples' => array_slice($settingKeys, 0, 15)], // İlk 15 setting'i göster
|
||||
'text' => ['label' => __('placeholder-picker.type_text'), 'examples' => ['company_name', 'title', 'description', 'subtitle']],
|
||||
'email' => ['label' => __('placeholder-picker.type_email'), 'examples' => ['contact', 'support', 'info', 'sales']],
|
||||
'url' => ['label' => __('placeholder-picker.type_url'), 'examples' => ['website', 'facebook', 'twitter', 'linkedin']],
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
|
||||
$favicon_path = setting('site_favicon');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
@@ -5,15 +9,17 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ setting('seo_meta_title') }} - {{ $meta['title'] ?? ($settings->default_meta_title ?? config('app.name')) }}</title>
|
||||
<meta name="description" content="{{ $meta['description'] ?? ($settings->default_meta_description ?? '') }}">
|
||||
<link rel="icon" href="{{ $settings?->favicon_path ? asset($settings->favicon_path) : asset('assets/img/favicon.ico') }}">
|
||||
<meta name="description" content="{{ $meta['description'] ?? (setting('seo_meta_description') ?? '') }}">
|
||||
<link rel="icon" href="{{ asset('storage/' . $favicon_path) }}">
|
||||
<link rel="stylesheet" href="{{ asset('html/style.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('assets/fonts/unicons/unicons.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/plugins.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/colors/grape.css') }}">
|
||||
<link rel="preload" href="{{ asset('assets/css/fonts/urbanist.css') }}" as="style" onload="this.rel='stylesheet'">
|
||||
|
||||
|
||||
<style>
|
||||
<?php echo setting('custom_css') ?>
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user