fetch & customised name tag for loop tag is not working
See original GitHub issue- Framework Version: v3.6.0 -CLIVersion: v1.4.0
- Node Version: v14.15.0
Hello, Thankyou for the amazing framework. I am very much new to maizzle. I have a issue
- fetch is not working
- customised name tag for loop tag is not working
config.js
module.exports = {
build: {
templates: {
source: "src/templates",
destination: {
path: "build_local",
},
assets: {
source: "src/images",
destination: "images",
},
posthtml: {
expressions: {
loopTags: ["for"],
},
},
},
},
message: "Hello Template",
fruits: ["apple", "mango", "orange"],
};
test.html(template file)
<extends src="src/layouts/main.html">
<block name="template">
<h2 class="text-yellow-600">{{page.message}}</h2>
</block>
<block name="temp">
<h3>Hey Shiva</h3>
<for loop="item, index in page.fruits">
<p>{{ item }}, my index is {{index}}</p>
</for>
<fetch url="https://jsonplaceholder.typicode.com/users">
<each loop="user in response">
{{ user.name }}
</each>
</fetch>
</block>
</extends>
- fetch part is not working (i tried both each and for)
- It is working with each tag but not with for
Please tell me what i am doing wrong, do i need to install any plugin if yes which one?
package.json
{
"private": true,
"scripts": {
"local": "maizzle build",
"production": "maizzle build production",
"watch": "maizzle serve"
},
"dependencies": {
"@maizzle/framework": "^3.0.0"
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Not able fetch the text from svg tag - selenium - Stack Overflow
I can understand you cant provide url but please find below example of svg element. //span[@class='float-left header-icon-left']//*[local-name ...
Read more >get_the_tags() | Function - WordPress Developer Resources
This function returns an array of objects, one object for each tag assigned to the post. If this function is used in The...
Read more >Suspense for Data Fetching (Experimental) - React
We call this approach “fetch-on-render” because it doesn't start fetching until after the component has rendered on the screen. This leads to a...
Read more >How to Create Custom Post Types in WordPress - WPBeginner
Hi, i am a newbie developer trying to create a custom post type. All is good, just 1 huge problem. I want to...
Read more >5. Working with Arrays and Loops - JavaScript Cookbook [Book]
Not all array elements have to be defined when created. For instance, if you create an array literal, you can use commas to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, looks like the
posthtml-fetch
plugin that provides that functionality is currently broken.We’ll need to fix that one first, but in the meantime you can use the approach outlined in the WordPress API tutorial:
https://maizzle.com/guides/wordpress-api-posts-email-newsletter/
Thankyou very much