content-management-system

How to fetch a single entry from Contentful and query by field value?

孤人 提交于 2021-02-19 16:07:36
问题 I am trying to retrieve a single entry based on the name custom field of my entry. I have tried using the JS SDK with various options: client.getEntry("entryID") // .where("content_type", "Restaurant") // .where("fields.name[match]", "RestaurantName") // .all() .then(data => console.log('data', data)) .catch(err => console.log('err', err)) But based on the errors back, it's suggesting I can only use .getEntry and pass in the entry ID. I also looked at making an HTTP request with axios but

How to fetch a single entry from Contentful and query by field value?

一个人想着一个人 提交于 2021-02-19 16:04:58
问题 I am trying to retrieve a single entry based on the name custom field of my entry. I have tried using the JS SDK with various options: client.getEntry("entryID") // .where("content_type", "Restaurant") // .where("fields.name[match]", "RestaurantName") // .all() .then(data => console.log('data', data)) .catch(err => console.log('err', err)) But based on the errors back, it's suggesting I can only use .getEntry and pass in the entry ID. I also looked at making an HTTP request with axios but

How to fetch a single entry from Contentful and query by field value?

£可爱£侵袭症+ 提交于 2021-02-19 16:01:13
问题 I am trying to retrieve a single entry based on the name custom field of my entry. I have tried using the JS SDK with various options: client.getEntry("entryID") // .where("content_type", "Restaurant") // .where("fields.name[match]", "RestaurantName") // .all() .then(data => console.log('data', data)) .catch(err => console.log('err', err)) But based on the errors back, it's suggesting I can only use .getEntry and pass in the entry ID. I also looked at making an HTTP request with axios but

Can't remove WooCommerce's image zoom

泄露秘密 提交于 2021-02-19 06:12:45
问题 I am trying to remove the image zoom from my custom themed website which uses WooCommerce. Here is what I've tried adding in my functions.php file: add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } and this add_action( 'wp', 'remove_pgz_theme_support', 20 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } I've spend some time googling but the

Can't remove WooCommerce's image zoom

你。 提交于 2021-02-19 06:11:24
问题 I am trying to remove the image zoom from my custom themed website which uses WooCommerce. Here is what I've tried adding in my functions.php file: add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } and this add_action( 'wp', 'remove_pgz_theme_support', 20 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } I've spend some time googling but the

moving a perl script/dbm to a new server, and shifting out of dbm?

旧巷老猫 提交于 2021-02-08 06:35:35
问题 I've been tasked with mirroring a site onto a new server. The old site has a few Perl scripts that, as far as I can see internally (i know nothing about Perl, though I have a pretty good understanding of coding generally, and specifically PHP/js/etc) aren't reliant on the old server. That said, when I try to run this script, which looks through a database file to find the appropriate article file, it doesnt retrieve anything. Basically, this is a rudimentary old CMS, as I explain it, where it

Identifying a Wordpress site

南笙酒味 提交于 2021-02-05 09:44:39
问题 Can any one please help me how to identify a given a website is a word press based or not ? For example: flashnewstoday.com 回答1: That website has the following in the header: <meta name="generator" content="WordPress 3.0.2" /> You can also try accessing WordPress-specific URLs, like http://flashnewstoday.com/wp-login.php 回答2: i usually just go to view-source and look for path that includes wp-content, and if it does most likely its wordpress powered. seems like flashnewstoday.com is wp

How do I add css class names to text blocks in Squarespace?

前提是你 提交于 2021-01-29 05:53:26
问题 I need to add a class name or an ID to a Squarespace textblock to be targeted by JavaScript. If I use a code block to add the text, I can add a class name, however it can't be edited easily like other text blocks. I am looking for a way to add the class name with the element still bing recognized as a text block. Is there a way to do this from the editor or is developer mode my only option. 回答1: Unfortunately, you cannot directly edit the HTML of a text block (or any block besides markdown

How do I add css class names to text blocks in Squarespace?

浪子不回头ぞ 提交于 2021-01-29 05:50:40
问题 I need to add a class name or an ID to a Squarespace textblock to be targeted by JavaScript. If I use a code block to add the text, I can add a class name, however it can't be edited easily like other text blocks. I am looking for a way to add the class name with the element still bing recognized as a text block. Is there a way to do this from the editor or is developer mode my only option. 回答1: Unfortunately, you cannot directly edit the HTML of a text block (or any block besides markdown

Fetch content from rich text field

送分小仙女□ 提交于 2021-01-28 21:12:43
问题 I am following this documentation to render rich text from Contentful. So far I have installed gatsby-source-contentful , now I am querying the rich text content with a graphQL query, before adding to my template. Issue: I cannot query the references field. From my understanding there was a recent breaking change that required the raw subfield to be queried...but unfortunately I can't query any subfield within raw . I am not sure what the issue can possibly be. Query { allContentfulArticle {