i'm a newbie of sonata, i configure in this way my config.yml
sonata_admin:
title: Name
templates:
layout: SonataAdminBundle::layout.html.twig
dashboard:
groups:
PartnerShop:
label: Partner Shop
icon: <i class="fa fa-car"></i>
items:
- admin.content
- admin.access
- admin.category
PagineComuni:
label: Pagine Comuni
icon: <i class="fa fa-bars"></i>
items:
- route: 'admin_app_comuni_edit'
route_params: { id: 1 }
label: Name
- route: 'admin_app_comuni_edit'
route_params: { id: 2 }
label: Brands
- route: 'admin_app_comuni_edit'
route_params: { id: 3 }
label: Gamma
- route: 'admin_app_comuni_edit'
route_params: { id: 4 }
label: Logistica
User:
label: Utenti
icon: <i class="fa fa-users"></i>
items:
- sonata.user.admin.user
- sonata.user.admin.group
roles: [ROLE_SUPER_ADMIN ]
in side menĂ¹ all it works, i see the correct list of admin, but in dashboard i see only the ParnerShop and User block, PagineComuni is not present
exist a way to display pagine comuni beetween ParnerShop and User?
thank you
Related
I am facing weird issue when using multi value and composite field in content app data is not stored in JCR properly, when used transformer class no error appears but no data is saved.
Following is my light module editor section
editor:
class: info.magnolia.editor.app.ContentEditorSubAppDescriptor
actions:
close:
class: info.magnolia.editor.action.CloseContentEditorActionDefinition
save:
class: info.magnolia.editor.action.SaveContentActionDefinition
saveAndPublish:
class: info.magnolia.editor.action.SaveContentActionDefinition
onSuccessAction:
class: info.magnolia.ui.framework.action.ActivationActionDefinition
command: activate
contentConnector:
workspace: rules
$type: jcrDatasource
nodeTypes:
- icon: icon-node-content
name: mgnl:content
strict: false
- icon: icon-folder-l
name: mgnl:folder
strict: false
contentDefinition:
outlineFields:
jcrName:
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
required: true
styleName: title
range:
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
collapsed: true
fields:
- name: rangeList
fieldType: multiValue
transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer
label: Range1
field:
name: rangeComponent
fieldType: composite
transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
fields:
- name: title
fieldType: text
label: Title1
- name: title2
fieldType: text
label: Title2
equals:
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
name: equalList
collapsed: true
fields:
equals:
name: equalComponent
fieldType: multiValue
class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
buttonSelectAddLabel: field.link.select.add
field:
name: equalElement
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
fieldType: text
blocks:
- text
initialBlock: text
linkableApps:
- pages
- assets
Equal section is working as expected but range section with composite part is not storing data.
Maybe the problem is the transformerClass which you're using in multiValue field. Try with the DelegatingMultiValueSubnodeTransformer:
- name: rangeList
fieldType: multiValue
transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueSubnodeTransformer
label: Range1
field:
name: rangeComponent
fieldType: composite
transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
fields:
- name: title
fieldType: text
label: Title1
- name: title2
fieldType: text
label: Title2
Hope it helps ;)
I want to remove the active class of list item which I had set intentionally active so when the page load I want this list item to remain active using routerLinkActive="active". I want to disable this active class when I select the other items of list in angular
I tried using ngClass but didn't worked as expected. How can this be done without using jquery?
<ul class="nav">
<li routerLinkActive="active" *ngFor="let menuItem of menuItems" [ngClass]="{'active': selectedItem == menuItem}" (click)="listClick($event, menuItem)">
<a class="nav-link" [routerLink]="[menuItem.path]">
<p>{{ menuItem.title }}</p>
</a>
</li>
</ul>
declare interface RouteInfo {
path: String,
title: String,
class: String
}
export const ROUTES: RouteInfo[] = [
{ path: '', title: 'Dashboard', class: '' },
{ path: '/vessel', title: 'Vessel Details', class: '' },
{ path: '/arrival', title: 'Arrival Details', class: ''},
{ path: '/stock', title: 'StockYard', class: ''},
{ path: '/cargo', title: 'Cargo Details', class: '' },
{ path: '/other', title: 'Others', class: ''}
];
menuItems: any[];
selectedItem= false;
listClick(event, newValue) {
console.log(newValue);
this.selectedItem = !this.selectedItem;
}
The intentionally setted active class should be disabled when other list items are clicked.
I see what your trying to do now. You shouldn't need to use ngClass or the click event. Angular will check to see if the active route matches the routerLink path. If it does, the class specified in ActiveRouterLink is added.
It's hard to solve your issue without knowing what you are seeing but try adding [routerLinkActiveOptions]="{exact: true} to the li element.
I work with EasyAdmin and I don't know how to add an image in list view.
I would like to add next to the prices two pictures (simply 2 logos) with a link to the website in question. The admin can click on logo A or B who redirect to the website.
I can insert my links with entiy's priority (Interface with links).
.
Here is my code:
app/config/config.yml
list:
fields:
- { property: 'low_amz', label: 'Amazon' }
- { property: 'url_amz', label: 'Amz', type: 'url' }
- { property: 'low_pm', label: 'PriceMinister' }
- { property: 'url_pm', label: 'Pm', type: 'url' }
But how I replace these link's value with my images. The images are stocked in local.
With my thumbnails, it works:
- { property: 'urlPdtImg', type: 'image', label: ' ' }
But in my case, I want just to change the value "string" in img. Of course, this does not work:
- { property: 'url_pm', label: 'Pm', type: 'url', base_path: '/img/Amazon.svg' }}
EasyAdmin Bundle 1.17.12
Symfony 3.4
Have a nice day.
Here are my files:
File config.yml:
- { property: 'url_amz', label: ' ', type: 'url', template: 'easy_admin/fields/_url1.html.twig' }
File _url.html.twig
<a href="{{ value }}">
<img src="{{ asset('Img/PM.svg') }}" alt="Amazon logo" style="height: 30px;"/>
Result
I can't update or create new contenttype 'Footer' I have this error on Bolt 3.0.11:
An exception occurred while executing 'SELECT id, as title FROM bolt_footer_fr footer_fr ORDER BY id ASC': SQLSTATE[HY000]: General error: 1 near "as": syntax error
How can I update contenttype footer?
I use SQLlite.
Here all my contenttype
home_en:
name: Home
singular_name: Home
fields: &home
title:
type: text
label: Title
group: header
name:
type: text
label: Name of the site
group: header
profession:
type: html
label: Name and profession
group: header
telephone:
type: html
label: Telephone
group: header
image:
type: image
label: Image of the header
group: header
text:
type: html
label: Text on header image
slug:
type: slug
use: title
relations:
home_fr:
multiple: false
label: Select a record
order: -id
icon_one: "fa:home"
icon_many: "fa:home"
record_template: index.twig
home_fr:
name: Accueil
singular_name: Accueil
fields: *home
icon_one: "fa-home"
icon_many: "fa:home"
relations:
home_en:
multiple: false
label: Select a record
order: -id
record_template: index.twig
section_en:
name: Section home
singular_name: Section home
fields: §ionHome
title:
type: text
label: Section title
text:
type: html
label: Text
slug:
type: slug
uses: title
taxonomy: [ order ]
relations:
section_fr:
multiple: false
label: Select a record
order: -id
section_fr:
name: Section accueil
singular_name: Section accueil
fields: *sectionHome
taxonomy: [ order ]
relations:
section_en:
multiple: false
label: Select a record
order: -id
about_en:
name: About
singular_name: About
fields: &about
slug:
type: slug
use: title
title:
type: text
label: Title
image:
type: image
label: image of you
text:
type: html
label: text
icon_one: "fa:user"
icon_may: "fa:user"
record_template: record.twig
relations:
about_fr:
multiple: false
label: Select a record
order: -id
about_fr:
name: Qui suis-je
singular_name: Qui suis-je
fields: *about
icon_one: "fa:user"
icon_may: "fa:user"
record_template: record.twig
relations:
about_en:
multiple: false
label: Select a record
order: -id
contact_en:
name: Contact en
singular_name: contact en
fields: &contact
slug:
type: slug
use: title
title:
type: text
label: title
contact_info:
type: html
label: Contact informations
slug:
type: slug
uses: name
name:
type: text
readonly: true
default: "contact"
map:
type: geolocation
label: Map
icon_one: "fa:envelope"
icon_many: "fa:envelope"
record_template: record.twig
relations:
contact_fr:
multiple: false
label: Select a record
order: -id
contact_fr:
name: Contact fr
singular_name: contact fr
fields: *contact
icon_one: "fa:envelope"
icon_many: "fa:envelope"
record_template: record.twig
relations:
contact_en:
multiple: false
label: Select a record
order: -id
footer_en:
name: Footer
singular_name: Footer
fields: &footer
copyright:
type: html
label: Copyright
social_media:
type: html
label: Social media
relations:
footer_fr:
multiple: false
label: Select a record
order: -id
footer_fr:
name: Pied de page
singular_name: Pied de page
fields: *footer
relations:
footer_en:
multiple: false
label: Select a record
order: -id
I have this error when update to 3.2.2 (and change hyphen to underscore):
In the ContentType for 'About', the relation 'about-fr' is defined, which is not a valid ContentType. Please edit contenttypes.yml, and correct this.
it's due to the underscore in the contenttype name. It's a bug in Bolt 3.0 and 3.1. Update to 3.2 and it will work.
I'm using SonataAdminBundle to generate a CRUD for my Page entity.
With the yaml file bellow the menu is displayed in the sidebar.
I would like to change the group default icon which is "fa fa-folder".
But I don't find the option to do it.
sonata.admin.page:
class: FM\AppBundle\Admin\Page\Page
tags:
- { name: sonata.admin, manager_type: orm, group: "CMS", label: "Pages" }
arguments:
- ~
- FM\AppBundle\Entity\Page\Page
- ~
"icon" option:
icon: "<i class=\"fa fa-folder\"></i>"
In your example:
sonata.admin.page:
class: FM\AppBundle\Admin\Page\Page
tags:
- { name: sonata.admin, manager_type: orm, group: "CMS", label: "Pages", icon: "<i class=\"fa fa-folder\"></i>" }
arguments:
- ~
- FM\AppBundle\Entity\Page\Page
- ~