add admin panel foe edite content
0
public/uploaded/1735143659-contact-us-min.jpg
Normal file → Executable file
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 247 KiB |
0
public/uploaded/ae8df0c4-7d20-45f8-9ba9-1177a1b7185d.webp
Normal file → Executable file
Before Width: | Height: | Size: 585 KiB After Width: | Height: | Size: 585 KiB |
0
public/uploaded/b315c85f-92c3-4d81-bc8c-72b698339f44 (1).webp
Normal file → Executable file
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
BIN
public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e (1).webp
Normal file
After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 462 KiB |
0
public/uploaded/e85efd21-e115-4103-b596-b91583928367.webp
Normal file → Executable file
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 311 KiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
|
@ -2,10 +2,15 @@
|
||||||
|
|
||||||
namespace App\Controller\Admin;
|
namespace App\Controller\Admin;
|
||||||
|
|
||||||
|
use App\Entity\Cat;
|
||||||
use App\Entity\Post;
|
use App\Entity\Post;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\CodeEditorField;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
||||||
|
@ -20,9 +25,18 @@ class PostCrudController extends AbstractCrudController
|
||||||
public function configureFields(string $pageName): iterable
|
public function configureFields(string $pageName): iterable
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
AssociationField::new('cat', 'نوع محتوا'),
|
||||||
|
AssociationField::new('tree', 'دستهبندی')->hideOnIndex(),
|
||||||
|
TextField::new('url', 'آدرس صفحه'),
|
||||||
|
TextField::new('version', 'شماره نسخه'),
|
||||||
TextField::new('title', 'عنوان'),
|
TextField::new('title', 'عنوان'),
|
||||||
TextareaField::new('intro', 'خلاصه مطلب'),
|
TextareaField::new('intro', 'خلاصه مطلب')->hideOnIndex(),
|
||||||
TextEditorField::new('body', 'متن'),
|
TextEditorField::new('body', 'متن')->hideOnIndex(),
|
||||||
|
CodeEditorField::new('plain', 'ساختار')->hideOnIndex(),
|
||||||
|
TextField::new('keywords', 'کلیدواژهها'),
|
||||||
|
ImageField::new('mainPic','تصویر شاخص')
|
||||||
|
->setUploadDir('/public/uploaded/')
|
||||||
|
->setBasePath('/uploaded/')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,4 +127,9 @@ class Cat
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return $this->getLabel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,4 +118,8 @@ class Tree
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
public function __toString(): string
|
||||||
|
{
|
||||||
|
return $this->getLabel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,16 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta lang="fa">
|
<meta lang="fa">
|
||||||
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
|
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
|
||||||
{% if block('des') is not defined %}
|
<!-- Google tag (gtag.js) -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K1R1SYQY8E"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'G-K1R1SYQY8E');
|
||||||
|
</script>
|
||||||
|
{% if block('des') is not defined %}
|
||||||
<meta content="{{twigFunctions.systemSettings.des}}" name="description"/>
|
<meta content="{{twigFunctions.systemSettings.des}}" name="description"/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<meta content="{{block('des') | trim}}" name="description"/>
|
<meta content="{{block('des') | trim}}" name="description"/>
|
||||||
|
|