Component link to any page/post

Hi team,

I’m trying to setup a new Component following the very simple example given here.

I’m trying to set the input for the parameter to a link, which in turn will allow the user to add a new button to their layout, select the text for the button itself and then select a page/post (or CPT) from the URL field I setup via a JSON snippet.

Screenshot 2025-02-24 at 17.48.25

I realise this is ‘advanced’ in terms of support, so I’m not asking for a solution. I just need to know if it’s possible to set this input to query the available posts/page on the site rather than relying on the user to always cut and paste a full URL in here, which would kind of defeat the purpose of having the builder content-managed to this degree as some clients are less likely to do this successfully.

Example of my JSON within the component parameters:

Screenshot 2025-02-24 at 17.55.41

Kind regards,

Geoff

There is a dynamic option for selecting a post via dynamic:post-picker:YOUR_POST_TYPE. It does force you to pass in a post type, which sounds like it might not work in your scenario. Hope this helps.

Parameters

{
  "post": {
    "type": "select",
    "options": "dynamic:post-picker:post"
  }
}

Where the link is you would then use this so it grabs a proper permalink for you.

{{dc:post:permalink post="{{dc:p:post}}"}}

You’re a star, @charlie - that works great, and to be honest if it just uses pages, that’s fine for now.

Thank you so much.

1 Like

Hi Geoff,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.