Support

Account

Home Forums General Issues Ajax issues with FSE archive template

Unread

Ajax issues with FSE archive template

  • Hi,
    I’m creating a generic load more system in a website for one of my client.
    The configuration of the system is done by ACF fields in a custom block. The global functioning is as follow:
    In the block settings you can:

    • set the post type to show
    • set a possible filter: either an interactive filter (a drop) or a fixed filter (archive)
    • the taxonomy associated to the filter
    • some other random settings (by page, etc.)

    In a page context, I have no issue. I send the page ID to the back and get_fields() works like a charm to force the desired configuration and return the new posts to load on front.
    But where I have an issue, it’s in a FSE template context.
    When I create a template for a taxonomy archive in the FSE Editor, ACF seems to save the fields value in the template’s post_content. And in this contexte I cannot fetch the fields values via get_fields() on back. I tried sending the get_the_ID(), get_queried_object_id(), etc. Nothing. ACF cannot recover the fields set in the FSE template.

    Is there a way to do this? As I do not want to send the post-type / taxonomy via ajax (and thus stored in the DOM) for security issues.

    Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.