Skip to main content

Questions tagged [headless]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

Craft CMS 5 Headless live preview using nuxt not working

I'm not understanding how the preview mode exactly works trough graphql queries for Craft CMS headless. Using Craft CMS 5. From what I read, all I have to do is add the 'token' in the headers of the ...
mtsfrstd's user avatar
0 votes
0 answers
30 views

How can I query for entries of a given type which point to a particular other entry by URI on a particular field?

I can run this query: mySectionEntries(myEntryRelationField: "target-id") { ... } This gets entries from section mySection which point to an entry with ID target-id on the entries ...
tremby's user avatar
  • 165
0 votes
0 answers
63 views

Frontend Authentication with GraphQl on different domain

I want to build a headless craft-cms site. Frontend is on mydomain.com, backend on login.mydomain.com However, i want users to login in the frontend and create a session there. Only logged in users ...
Juice's user avatar
  • 1
0 votes
0 answers
43 views

Multisite/Multidomain and headless mode

Our company has two websites. Both sites were build independently with Craft CMS. One site uses Twig templates, the other operates in headless mode. Is it possible to „mix“ them in one Craft system, ...
Matthias H's user avatar
1 vote
1 answer
41 views

Is there a way to determine an element by its path or full url instead of the uri?

I'm using Craft in headless mode. It's a multisite setup different languages. I know that's it's possible to query an element by it's uri. Is there a way to check if a full path or an absolute url ...
user14370's user avatar
1 vote
1 answer
474 views

CraftCMS headless / Nuxt - not getting live preview to work

Over the past few weeks I've been working on a headless CraftCMS integration with Nuxt for the frontend. I use Apollo and GraphQL to fetch the data from the CMS. Almost there now, but there's one ...
Maik_BEELDR's user avatar
1 vote
1 answer
63 views

GraphQL fields with applied typogrify - any suggestions?

we love CraftCMS and also typogrify plugin with Twig filter "|typogrify". Now we are starting a web project that will combine Astro and CraftCMS will be used headless with the use of GraphQL ...
jan.reges's user avatar
1 vote
1 answer
275 views

Language prefix in URL with correct entry URIs

I never used Craft before and I'm trying to create a multi-language site (in headless mode) but am running into problems with adding the language to the URL. My goal is to have URLs that always start ...
Thomas's user avatar
  • 133
1 vote
0 answers
80 views

Maintaining the same page creating experience in a headless Craft CMS configuration - Next.js

I don't see a clear path to get the full page creating experience in any headless configuration as is available in Craft/Twig. The routing in next.js specifically I think is the main obstacle. Next.js ...
chris's user avatar
  • 21
1 vote
0 answers
321 views

Craft CMS Headless - Preview mode

I'm new on craft and I'm using headless mode with a nextJs frontend application. I've tried to configure the preview mode to load the frontend, but I didn't find how to do that. The frontend ...
William Luis Alberton's user avatar
1 vote
1 answer
227 views

Persist session from frontend login form to craft dashboard on headless install

Im im using craft as a headless CMS to power a Nuxt frontend. I have a situation where i need the user to login on the frontend and then be redirected to a url within the craft CMS admin. My question ...
Jamie Nuom's user avatar
1 vote
1 answer
100 views

Additional code to run when cache is busted(entry added/updated, etc)

I'm using Craft Pro 3.6 in Headless mode. I've found that caching the GraphQL responses on the frontend server dramatically speeds up our load time, even with enableGraphQlCaching turned on. What I'd ...
Tao's user avatar
  • 13
1 vote
2 answers
767 views

WARNING: heuristic fragment matching going on! when querying matrix fields or any query with multiple fragment types with Graph QL using Nuxt Apollo

I am relatively new to using Craft Headlessly and am trying to query matrix fields with Nuxt JS and it's Apollo module. I have discovered, that although the graphQL queries work in the GraphiQl ...
ToddPadwick's user avatar
2 votes
1 answer
1k views

JS login form on different domain and handling the CSRF token

Having sorted out the CORS issue and succesfully logging into Craft from a different domain using Javascript, I've now turned CSRF protection back on. I've got a module returning the CSRF token name ...
Clive Portman's user avatar
2 votes
1 answer
628 views

Is there a guide for using Craft Commerce headless?

I’m trying to figure out the work involved in using Craft Commerce in a headless setup. Is it possible? I think so. How do I expose the Commerce functionality via an API, instead of through Twig ...
William's user avatar
  • 41
2 votes
1 answer
1k views

CraftCMS + GraphQL - orderBy Random?

I'm currently building my first JAM stack app using Nuxt as my front-end framework and Craft as my headless CMS. I'm leveraging Apollo as my GraphQL interface client. I have it pulling data back just ...
Rob Erskine's user avatar
1 vote
1 answer
316 views

Headless mode/ElementAPI: how to set the frontend's baseUrl in the backend endpoint?

I am having an ongoing confusion in headless mode. Imagine a site with 2 servers: Backend (Craft with element API) on https://backend.site Frontend (vue.js) on https://frontend.site Editors pick ...
Urs's user avatar
  • 639
1 vote
1 answer
776 views

Headless Live Preview with Gatsby

I am following Andrew Welch's post here - https://twitter.com/nystudio107/status/1168220713158942720?lang=en I used the gatsby-config.js file he shared here - https://gist.github.com/monachilada/...
fxfuture's user avatar
  • 279
1 vote
1 answer
425 views

getting active userid by GraphQL?

I build a SPA with Craft CMS and Vue. I use Vue Router and have three Props. Here is my current router-view: <router-view csrfName="{{craft.app.config.general.csrfTokenName}}" csrfToken="{{...
Peter L's user avatar
  • 86
1 vote
1 answer
143 views

How to loop through Craft CMS query in Angular

Given the following query sample, how can I loop through the entries past the first array in Angular? Here is the query sample: query sample ($section: [String], $type: [String], $slug: [String]) { ...
Trish20's user avatar
  • 31
5 votes
1 answer
2k views

How do you set up live preview for headless Craft CMS installs connected to Gatsby?

How do you set up live preview for headless Craft CMS installs connected to Gatsby?
Anonymous's user avatar
  • 105
2 votes
1 answer
1k views

Headless CraftCMS: How can I tell Craft to load live preview from a different (sub)domain?

I will be using CraftCMS (Craft Solo 3.3.18.4) in headless mode as the backend for a Rails app. The Craft instance lives on a different subdomain. How do I instruct craft to use the rails app URI ...
aaandre's user avatar
  • 155
1 vote
1 answer
193 views

Image processing in headless mode

How to do image processing & transformations when not using templates? I'm using react-static for the frontend. Is it possible to have CraftCMS process the images upon upload?
riccardolardi's user avatar
2 votes
0 answers
570 views

How to authenticate as a Craft user with a frontend tool like Next.js, Nuxt.js, or create-react-app?

We're looking to use Craft CMS as an application platform (handling content storage, user authentication, etc) for an upcoming project while leveraging something like Next.js on the front-end. Here's ...
Aaron Bushnell's user avatar
1 vote
1 answer
97 views

Using Craft to render frontend pages in addition to using it headless

I’m looking to create a craft site for some digital storytelling pieces. The pages will be curated by various people within my team. But I also like the idea of using the CMS to push separate content ...
Whale Creative's user avatar
1 vote
1 answer
418 views

Headless Craft CSRF

I have a site that is using Craft CMS headless and React. There are a few forms that need to post to controllers but I'm not sure how to set up the CSRF tokens and keep it secure. Can anyone advise ...
WillBV's user avatar
  • 81
1 vote
0 answers
27 views

Locales with independent language and country

How might we use Craft to manage our locales, keeping our language and country logic independent? The desired scenario: No duplicate language entries: Spanish in Spain would be the same as Spanish in ...
Sean O'Brien's user avatar
4 votes
1 answer
1k views

Headless CraftCMS as mobile app backend, requiring login

Currently building a mobile app with Phonegap, I'm able to use the Element API for many features, but when comes the time to use Craft as a loggedin user, I run out of ideas. I read a lot of things ...
r-ninja's user avatar
  • 147
2 votes
1 answer
2k views

CSRF in “Headless” Applications

There are a number of answers here about how to send CSRF tokens along with AJAX requests, but I think my question is a little different. Please excuse the abstractness here: In a headless ...
August Miller's user avatar