acf_register_block_type did not show up in frontpage - acfpro

I recently created a custom block type with acf like mentioned in the doc, it works just fine in the edit interface in the back-office, but in the front I did not get anything, and when i inspect the html code i get the content commented like this:
<!-- wp:acf/highlighted-posts { "id": "block_5e97574edd1fa", "name": "acf\/highlighted-posts", "data": { "titre": "", "_titre": "field_5e972e607d71e", "read_more": "", "_read_more": "field_5e973516c767d" }, "mode": "preview" } /-->
Any ideas please ! ?

For anyone who is facing this issue: you must use the WordPress Built in function the_content(), otherwise the content will not be parsed correctly. Or you can use the method parse_blocks(), more information’s in the following link :
https://developer.wordpress.org/reference/functions/parse_blocks/

Related

Vscode API - Custom View Container Not Showing

I am currently writing a vs-code FTP type extension, which requires me to use the "TreeView". I have found this link:
https://code.visualstudio.com/api/extension-guides/tree-view
Which guides you through adding a tree view to the sidebar. However I am having trouble getting this off the ground, Step one on the above mentioned guide already does not seem to add the icon to my vscode sidebar? Thus holding from making any progress...
Obviously I am misunderstanding something! I am rather new to TypeScript and have trouble following others code on this subject. Please could anyone just help me getting the first step working?
This is my package.json contributes:
"contributes": {
"commands": [
{
"command": "extension.helloWorld",
"title": "Hello World"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "live-workspace",
"title": "Live-Workspace",
"icon": "./src/Treeview/laptop.svg"
}
]
}
}
From what I understand this should place a "functionless" icon on the sidebar? Am I understanding this wrong? Is there more to be done to achieve this? Thanks!
A view container will only show up if it contains at least one view. It works for me once I also add the following to the contributes section:
"views": {
"live-workspace": [
{
"id": "exampleView",
"name": "Example View"
}
]
}

Can't get suggestions in snippets

I have customized one snippet:
"Import for eslint": {
"prefix": "import",
"body": [
"import { $2 } from '$1'",
],
"description": "import (eslint)"
}
Though it works well, but I can't get suggestions when you code the file path($1), Like this:
the image No Suggestions
the code has highlight background, and don't have suggestions, How should I do some work to implement the feature like this:
only has cursor
Try changing to
"editor.suggest.snippetsPreventQuickSuggestions": false,
true is the default which may be preventing you from seeing suggestions inside your snippet. You want false.

Correctly escaping in snippet?

I'm currently facing an issue where my snippet is not correctly rendered when used.
Snippet
"Import": {
"prefix": "import",
"body": ["import ${1: { ${2:module} } } from \"${0:library}\";"],
"description": "Import module (es6)"
},
The problem
This is the first tab, as you can see it does not select the } for some reason. The other tabs are working fine. I've tried a couple of possibilities but they are not resolving the issue.
You need to escape the second '}' with '\'. The following works.
"body": ["import ${1:{ ${2:module} \\}} from \"${0:library}\";"],

get date using Angular-UI Bootstrap Datepicker inside Modal opened from Grid cell

Maybe this is overkill, but I am trying to
1. open a Modal window, when a link is clicked in UI-Grid
can be done by modifying http://ui-grid.info/docs/#/tutorial/110_grid_in_modal
2. Put a (ui.bootstrap.datepicker) inside the Modal
3. Retrieve the chosen date
4. update the Date Cell in that UI-Grid Row
so, Is Ui-Grid 'well suited'/'can do this' given the above requirements
tia
Nope, not overkill. You can do this with UI-Grid pretty easily. There's a guide on how to do hook up modal editors using Angular Schema Form here: http://brianhann.com/create-a-modal-row-editor-for-ui-grid-in-minutes/ (caveat: I'm the author).
I've also created a new plunker that uses the angular-schema-form-datepicker library to show how you might do this: http://plnkr.co/edit/7t3BI2AUcnvNfav78Btr?p=preview
(plunker has been throwing 404s for files that are part of a plunk so you might have to refresh it)
The main things you have to do are set up your object schema:
scope.schema = {
"type": "object",
"properties": {
"myDate": {
"title": "My Date",
"type": "string",
"format": "date"
}
}
}
Using the same property as your column Defs:
columnDefs = [
{ field: 'myDate', name: 'My Date' }
]
And specify your date format in your form:
form = [
{
key: 'myDate',
format: 'yyyy-mm-dd'
}
]

How to set default value for FilteringSelect widget in Dojo Data Grid?

I am trying to display dynamic values read for a store as options within a filteringSelect widget in my DOJO Data Grid. The values are getting populated as expected however, I am unable to display a default value when the grid loads, right now it shows up as "..." on single click, I am able to see a drop down.
Below is the location of the sample code:
http://jsfiddle.net/R64bE/2/
I want to iterate through my "myStore" in the code above and make the item with label = 'Y' as the default for that filteringSelect.
I want the default value displayed as soon as the grid or filtering select is rendered. Any pointers or sample code will be of great help.
Glad that I was able to fixed it too..Below is the code in case anyone wants to achieve something similar.
Working code with Default value
Basically all I had to do was send a default value for that field/cell in the first json I created.
jsonStore = new dojo.data.ItemFileWriteStore({
data: {
"identifier": "identify",
"label": "description",
"items": [
{
"identify": 123,
"description": "Project Manager",
"billingMethod":"Sample"},
{
"identify": 234,
"description": "Developer"},
{
"identify": 536,
"description": "Developer"}
]
}
});
Notice that all I had to do was add a value for that column in the json, i.e., for Billing Method Column, I added "billingMethod":"Sample" and it picks it up from there.
Cheers