Support

Account

Home Forums Add-ons Options Page Using Elementor with Options Pages

Solved

Using Elementor with Options Pages

  • With the advent of the new Options Pages, my first thought was that I could store website-related information that I frequently reuse throughout a site that could be changed in a central location. For examples, the address and phone number of the company for whom the website is being built.
    With that in mind, I created an Options Page and then connected it to a field group consisting of some address fields, similar to what I’d do were I connecting a field group to a page or post. I then filled in those fields via the new option that had then appeared on the left-hand WP menu.
    On a page made with Elementor, I then added a text field and attempted to link it to the ACF field. ACF came up in the list of possible fields, but the ‘key’ field is empty. In other words, there’s no connection of these ACF fields to Elementor.
    Perhaps because this Options Pages feature is new, Elementor has no way to handle this yet.
    If there’s a way to do this without necessarily using Options Pages, could someone direct me to instructions of how I’d go about it?
    Thanks in advance for the help.

  • The Elementor option will only detect fields that are saved as part of the post that you are editing. For options pages or when you are getting ACF fields from anywhere other than the current post requires the use of shortcodes and supplying the post ID (in this case “options”). ACF has a shortcode that works for simple fields. You have to build your own shortcodes for complex fields.

  • Thanks for your response, John.
    I had no idea that ACF supported the use of shortcodes!
    Using this newly-gained knowledge from you, I understand that because I am getting the ACF fields from anywhere other than the current post (for me it would be one of many pages), then using a shortcode in the format [acf field="field_name" post_id="123"] should get me what I need, substituting the word ‘options’ rather than a post ID.
    Because one of the field names in what I created was business_name, I’ve created this shortcode: [acf field="business_name" post_id="options"] and placed it within some plain text.
    Using this within an Elementor text editor field doesn’t yield any result. Literally nothing appears on the front end other than the plain text preceding and after those square brackets.
    What am I doing wrong?

  • Where is the value saved? on an options page? On a post?

  • As indicated by the post title, I was using an Options Page.

    Please look at this screenshot for as much info as I can provide: https://notes.websmithian.com/l/HmS8J4

    Anything more you need to know?

    Thanks for continuing to help me!

  • Sorry, sometimes I’m asleep.

    How did you create the options page? What is the value you used for the “post_id” argument?

  • I have figured out the solution to my problem, helped by a YT video that appeared yesterday and gave me some clues.
    My original aim was to use some fields created on an Options Page with Elementor. After approaching ACF tech support and receiving a very cryptic and complex answer, most of which was unintelligible to me, I concluded that Elementor didn’t support the use of ACF Options Pages.
    My backup plan was to then use shortcodes to achieve what I’d set out to do.
    My folly was in creating a Group field in ACF and then putting those various subfields (e.g. business name, phone number) into that set. It didn’t work in Elementor and neither did the shortcodes.
    In the end, remaking the Field Group with discrete (i.e. not Group) fields totally solved the problem. I can now use Elementor’s dynamic fields control and shortcodes, if I prefer!
    Thank you for all of your help on this.

  • Group field sub fields can be accessed by shortcode using "{$group_field_name}_{sub_field_name}"

  • I created the options page mainly by following the directions in this short YT video: https://youtu.be/0As393DZyZs

    I’m not exactly sure what you’re asking for, so have responded by recording a quick “video tour” of my configuration, hoping you’ll see the answer you’re looking for somewhere in it!

    https://notes.websmithian.com/l/0uoEPX

    Thanks for the help (and for staying awake!).

  • For some strange reason, my response doesn’t seem to be submitting! This is my third try – so apologies if you’ve received one or two responses previous to this one.

    I followed the short YT tutorial at https://youtu.be/0As393DZyZs for instructions on how to do this.

    Not knowing how to directly answer your question I’ve recorded a short video tour of my configuration:

    https://youtu.be/0As393DZyZs

    Thanks for your continued help – and for staying awake!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.