How to display selected taxonomy of an article in Rest view in drupal 8 - rest

How to display selected taxonomy of an article in Rest view in drupal 8
I have created a view with rest export as follows
Format = Serializer
Settings = Fields , Settings
Fields :
Content: Title
Content: Category
Under category i have choosed the below settings:
Filter criteria
Content: Published (= Yes)
Content: Content type (= News)
But when i view the json, the category field, selected taxonomy term is not displaying.

I have created the rest view in Drupal 8 with Article content type for following fields
Title
Tag
Below the export views code change the your project UUID and import it.
uuid: 435345-345ty-4354-35345f-534534fdf
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_tags
- node.type.article
module:
- node
- rest
- serialization
- user
id: test_rest_view
label: 'test rest view'
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: serializer
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
title:
id: title
table: node_field_data
field: title
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: false
ellipsis: false
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: node
entity_field: title
plugin_id: field
field_tags:
id: field_tags
table: node__field_tags
field: field_tags
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: false
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
filters:
status:
value: '1'
table: node_field_data
field: status
plugin_id: boolean
entity_type: node
entity_field: status
id: status
expose:
operator: ''
group: 1
type:
id: type
table: node_field_data
field: type
relationship: none
group_type: group
admin_label: ''
operator: in
value:
article: article
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: node
entity_field: type
plugin_id: bundle
sorts:
created:
id: created
table: node_field_data
field: created
order: DESC
entity_type: node
entity_field: created
plugin_id: date
relationship: none
group_type: group
admin_label: ''
exposed: false
expose:
label: ''
granularity: second
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_tags'
rest_export_1:
display_plugin: rest_export
id: rest_export_1
display_title: 'REST export'
position: 1
display_options:
display_extenders: { }
path: testreset
pager:
type: some
options:
items_per_page: 10
offset: 0
style:
type: serializer
options:
formats:
json: json
row:
type: data_field
options:
field_options:
title:
alias: ''
raw_output: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_tags'
See rest output

Related

TYPO3 - cms-forms - Remove Input from Email

I am trying to remove an input field from the generated email. With Powermail it is relatively easy. There I can exclude fields in the typoscript. How could something like this look with cms-forms?
Example powermail
excludeFromPowermailAllMarker {
# On Confirmation Page (if activated)
confirmationPage {
# add some markernames (commaseparated) which should be excluded
excludeFromMarkerNames = datenschutzbestimmungen, agb
}
}
TYPO3 11.5.12
php 8.1.2
This is possible with the form variants introduced in TYPO3 version 9.
Hide a form element in certain finishers and on the summary step:
type: Form
identifier: test
prototypeName: standard
label: Test
finishers:
-
identifier: EmailToReceiver
options:
subject: Testmail
recipientAddress: tritum#example.org
recipientName: 'Test'
senderAddress: tritum#example.org
senderName: tritum#example.org
renderables:
-
type: Page
identifier: page-1
label: 'Page 1'
renderables:
-
type: Text
identifier: text-1
label: 'Text 1'
variants:
-
identifier: hide-1
renderingOptions:
enabled: false
condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'
-
type: Text
identifier: text-2
label: 'Text 2'
-
type: SummaryPage
identifier: summarypage-1
label: 'Summary step'
The relevant part (which disables rendering of the field in the summary page, the email to sender finisher or the email to sender finisher) is
variants:
-
identifier: hide-1
renderingOptions:
enabled: false
condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'

Azure bicep Storage account sku is read-only

I am trying to deploy a storage account using azure bicep.
In my code:
resource storageAccounts_storageacntin_name_default 'Microsoft.Storage/storageAccounts/blobServices#2021-04-01' = {
parent: storageAccounts_storageacntin_name_resource
name: 'default'
sku: {
name: 'Standard_RAGRS'
tier: 'Standard'
}
properties: {
changeFeed: {
enabled: false
}
restorePolicy: {
enabled: false
}
containerDeleteRetentionPolicy: {
enabled: true
days: 7
}
cors: {
corsRules: []
}
deleteRetentionPolicy: {
enabled: true
days: 30
}
isVersioningEnabled: true
}
}
I get an error in the SKU. The error is the following.
The property "sku" is read-only. Expressions cannot be assigned to read-only properties.bicep(BCP073)
I don't fully understand why is this error showing up, I am still new to azure bicep and trying to move slowly from terraform deployments to azure bicep.
Please can anyone explain me why is this error is coming up and how to solve it?
Thank you so much
UPDATE CODE:
this is the error I am getting when I removed the sku
param storageAccounts array = [
'storage1'
]
resource storage_Accounts 'Microsoft.Storage/storageAccounts#2021-04-01' = [ for storageName in storageAccounts :{
name: [storageName]
location: 'westeurope'
sku: {
name: 'Standard_RAGRS'
tier: 'Standard'
}
kind: 'StorageV2'
properties: {
allowCrossTenantReplication: true
minimumTlsVersion: 'TLS1_2'
allowBlobPublicAccess: false
allowSharedKeyAccess: true
networkAcls: {
bypass: 'AzureServices'
virtualNetworkRules: []
ipRules: []
defaultAction: 'Allow'
}
supportsHttpsTrafficOnly: true
encryption: {
services: {
file: {
keyType: 'Account'
enabled: true
}
blob: {
keyType: 'Account'
enabled: true
}
}
keySource: 'Microsoft.Storage'
}
accessTier: 'Hot'
}
}]
resource storageAccounts_hamzaelaouane1_name_default 'Microsoft.Storage/storageAccounts/blobServices#2021-04-01' = [ for storageName in storageAccounts: {
parent: [storage_Accounts]
name: storageName
properties: {
changeFeed: {
enabled: false
}
restorePolicy: {
enabled: false
}
containerDeleteRetentionPolicy: {
enabled: true
days: 7
}
cors: {
corsRules: []
}
deleteRetentionPolicy: {
enabled: true
days: 30
}
isVersioningEnabled: true
}
}
]
the error is at the last 2 lines. It says that is expecting } and ] at that point. Checking line by line, I couldn't see any error on syntax
The sku field is read-only for services that are under a storage account like blobServices and fileServices.
You can (only) set the SKU on Storage Account level (Microsoft.Storage/storageAccounts#2021-04-01).
To be complete; the tier field is also read-only on the storage account, since it's based on the SKU name. Remove these fields and you should be good to go.

TYPO3 tx_form doesn't render submit button

I have a 10.4.18 installation, on another project that works fine (which i copy to the current). In my current project they render the submit button like this:
<span class="btn-group next submit">
Absenden
</span>
There is no button and not clickable, anyone have an idea? There are no template overrides or custom configuration, form is added in template (without I get an exception) so that works.
The yaml configuration:
renderingOptions:
submitButtonLabel: Absenden
identifier: kontakt
label: Kontakt
type: Form
prototypeName: standard
finishers:
-
options:
subject: 'Kontakt über Website'
recipients:
test#test.de: 'Test Webmailer'
senderAddress: '{email}'
senderName: '{vorname}'
attachUploads: true
translation:
language: default
useFluidEmail: true
title: 'Confirmation of your message'
addHtmlPart: true
identifier: EmailToReceiver
renderables:
-
renderingOptions:
previousButtonLabel: ''
nextButtonLabel: ''
identifier: page-1
label: Kontakt
type: Page
renderables:
-
properties:
options:
Anfrage: Anfrage
Lob: Lob
Kritik: Kritik
type: SingleSelect
identifier: singleselect-1
label: 'Ihr Anliegen'
defaultValue: Anfrage
-
defaultValue: ''
identifier: vorname
label: 'Ihr Name'
type: Text
properties:
fluidAdditionalAttributes: { }
elementDescription: ''
-
defaultValue: ''
identifier: email
label: 'Ihre E-Mail-Adresse'
type: Text
properties:
fluidAdditionalAttributes:
required: required
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: nachricht
label: 'Ihre Nachricht'
type: Textarea
properties:
fluidAdditionalAttributes:
required: required
elementDescription: ''
validators:
-
identifier: NotEmpty
-
properties:
pageUid: '13'
linkText: 'Datenschutzerklärung anzeigen'
fluidAdditionalAttributes:
required: required
type: LinkedCheckbox
identifier: linkedcheckbox-1
label: 'Ja, ich habe die Datenschutzerklärung zur Kenntnis genommen.'
validators:
-
identifier: NotEmpty

TYPO3: Form properties.fluidAdditionalAttributes.placeholder translation

I'm working on translating my Typo3 page.
Now I've come to my contact form which I want to translate. From the Typo3 Documentation I've found that I need something like this:
contact.element.subject.properties.fluidAdditionalAttributes.placeholder
...as the translation ID inside my locallang.xlf file. I've linked my CustomFormSettings.yaml via TypoeScript, in there set the translation path to my extension and created a contact form.
I was actually able to translate the submit button for example and other buttons. But I can't get the placeholder inside my contact form to get translated, they all fallback to the value set in the contact form not the translation.
I'm guessing I'm handling the fluidAdditionalAttributes property wrong but I've tested lots of other combinations then the above.
What is the exact line I have to type inside my translation ID?
Here is my complete contact form:
renderingOptions:
submitButtonLabel: Submit
identifier: contact
label: Contact
type: Form
prototypeName: frameform
finishers:
-
options:
subject: 'Your message: {subject}'
recipientAddress: mail#mail.com
recipientName: 'Recipient Name'
senderAddress: '{email}'
senderName: '{name}'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
translation:
language: ''
identifier: EmailToReceiver
-
options:
subject: 'We have received: {subject}'
recipientAddress: '{email}'
recipientName: '{name}'
senderAddress: mail#mail.com
senderName: 'Sender Name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
identifier: EmailToSender
-
options:
pageUid: '7'
additionalParameters: ''
identifier: Redirect
renderables:
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: mainPage
type: Page
renderables:
-
defaultValue: ''
identifier: name
label: Name
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Name
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: subject
label: Subject
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Subject
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: email
label: Email
type: Text
properties:
fluidAdditionalAttributes:
placeholder: 'Email address'
required: required
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: message
label: Message
type: Textarea
properties:
fluidAdditionalAttributes:
placeholder: Message
required: required
minlength: '10'
maxlength: '512'
validators:
-
identifier: NotEmpty
-
options:
minimum: '10'
maximum: '512'
identifier: StringLength
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: summarypage
label: 'Summary page'
type: SummaryPage
You can override your placeholders in a locallang.xlf like this: element.<field-identifier>.properties.placeholder
example:
<trans-unit id="element.firstname.properties.placeholder">
<source>Your first name</source>
<target>Ihr Vorname</target>
</trans-unit>

Avoiding global leaking when using JayData 1.3.4 local item store

Out of the box Entities defined by using $data.Entity.extend will be globally accessible. e.g. in the example taken from JayData's home page Todo will leak.
// Case 1: local item store example from http://jaydata.org/
$data.Entity.extend("Todo", {
Id: { type: "int", key: true, computed: true },
Task: { type: String, required: true, maxLength: 200 },
DueDate: { type: Date },
Completed: { type: Boolean }
});
console.log('Leaks Todo?', typeof window.Todo !== 'undefined');
//Result: true
In a JayData forum post I found a reference to $data.createContainer(), which can be used as container during Entity definition. In this case Todo2 won't leak.
// Case2: creating Todo2 in a container
$data.Entity.extend("Todo2", container, {
Id: { type: "int", key: true, computed: true },
Task: { type: String, required: true, maxLength: 200 },
DueDate: { type: Date },
Completed: { type: Boolean }
});
console.log('Leaks Todo2?', typeof window.Todo2 !== 'undefined');
//Result: false
Unfortunately after accessing stores there'll be other variables that leak globally even if the Entity itself is associated with a container.
console.log('Before store access: Leaks Todo2_items?',
typeof window.Todo2_items !== 'undefined');
//Result: false
$data('Todo2').save({ Task: 'Initialized Todo2'})
console.log('After store access: Leaks Todo2_items?',
typeof window.Todo2_items !== 'undefined');
//Result: true
Complete fiddle can be found at http://jsfiddle.net/RainerAtSpirit/nXaYn/.
In an ideal world every variable that is created for entities that run in a container would be associated with the same container. Is there an option to accomplish that or is the behavior described in Case2 the best that can be currently accomplished?