Home » Topics » General Support » Widget Titles / multiple instances of widget

Widget Titles / multiple instances of widget

ACF Widgets Support General Support Widget Titles / multiple instances of widget

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1898
    Michelle McGinnis
    Participant

    Hi – how do I add a title / title field to a widget?

    For instance: I have created a widget called Featured Books, and successfully dragged it into my sidebar, filled out the associated custom fields, and have them successfully displaying on the front end of my site. I now go back and add another instance of the Featured Books widget in the same sidebar. Looking at those widgets in the Appearance > Widgets control panel page, I can’t tell them apart without opening them up because neither has its own title – they’re both just called Featured Books.

    I’m afraid my clients will have half a dozen of these in each sidebar, and it’ll be a pain to locate the ones they want to edit. Also, they’re already familiar with widget titles, so it’d be convenient to use the default WP functionality/interface for that.

    So – can I add in a ‘title’ field so I can distinguish between the widgets in the control panel – and use that on the front-end too while we’re at it? A filter for this would be fine if you don’t want to hard-code it in for everyone. ?? (I got a dev license but don’t have access to the Priority forum yet which is why I’m posting here. )

    Thanks for the great plugin and your help!

    #1900
    Daron Spence
    Keymaster

    Hi Michelle, I recently rewrote a bunch of stuff for v1.4 so this could be a much easier task than it would have been in the current release!

    As to your questions, you can already add a field called “title” and use it on your site. Just add another one in the ACF field group. However, that obviously won’t work as expected. Now that can be resolved, however, I imagine that it will be an opt-in feature for a few releases and then will become defacto. Since all of the current users don’t have titles, I will have to provide some backwards comparability support for that… sorry, just typing out loud here.

    Also, your priority support license is supposed to activate when you log in to the site, so imagine it never logged you out from when you purchased it the first time. Regardless, I’ve fixed that for you 🙂

    If you want, open an issue on GitHub and I’ll keep working on it. If you’re interested, I’m also looking for beta testers! I’ll be sending out an email either later today or tomorrow regarding that tidbit and reminding everyone about GitHub.

    https://github.com/Daronspence/acf-widgets

    #1901
    Daron Spence
    Keymaster

    Michelle,

    Here is a link to download the current develop branch with this feature in it.

    You’ll need to add a filter in your functions.php to show the titles.

    add_filter('show_acfw_titles', '__return_true');

    https://github.com/Daronspence/acf-widgets/tree/title-feature

    #1931
    Michelle McGinnis
    Participant

    Wow, thank you! that was so quick – and it works perfectly. I tested with a few different widgets, put a bunch o’ single-and-double quotes in the title, saved, moved in and out of inactive/active widget areas, all good.

    Thank you!! I’ll be happy to beta test, and I’m sure I’ll be using this a ton for my clients.

    #1932
    Daron Spence
    Keymaster

    Glad it worked out for you! Did all of your existing field values carry over? That’s my biggest concern. I really did rework the entire widget creation/registration process so I want to make sure I don’t break anything moving forward with the update.

    #1933
    Michelle McGinnis
    Participant

    Didn’t see any issues with the field data carrying over and didn’t need to edit my display code at all. I had a few regular fields and a few nesting repeaters / relationship queries going and they all worked fine. 🙂

    #1934
    Daron Spence
    Keymaster

    Oooh that sounds fun. Mind sharing some gists? 🙂

    #1935
    Michelle McGinnis
    Participant
    #1936
    Daron Spence
    Keymaster

    Awesome stuff! Funny to see someone actually using “books” for these types of things. Sometimes those tutorials are right on the money! 🙂

    I’m marking this thread as closed. If you have any more questions, you can open a new topic or reply to this one if it’s the same issue.

    Thanks for supporting the plugin! I really appreciate it 🙂 Be sure to spread the word! 😀

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Widget Titles / multiple instances of widget’ is closed to new replies.