December 1, 2014 at 3:32 PM #478
Would be cool to see a custom widget ID or Class option when adding/editing a new widget, instead of having this generated for you:
<div id="acf_widget_30418-2" class="widget Acf_Widget_30418">
Cheers.December 1, 2014 at 3:47 PM #479
This is a good idea. I was privately emailing with one of the beta testers about something like this. Definitely a possibility. I’ll look into it for sure.
What about just using the widget slug as a classname? Or would user defined classes/id’s be more useful?December 1, 2014 at 3:51 PM #480
Yeah, I’m definitely going to use what’s available for now, but my anal self wants more control over the selectors!
For example, in the above code snippet, that widget div is preceded by:
<div id="mc_newslettersignup" class="widget widget_mc_newslettersignup">
I’d love to give the widget generated by your plugin its own custom ID or class. Of course it isn’t necessary for it to work; just a nice perk, and my CSS will make more sense to me.December 1, 2014 at 3:54 PM #481
Ok. I’ll see what I can do. Hopefully I can work on it later tonight.December 3, 2014 at 1:07 PM #745
Hey Jason, just wanted to note, that until you activate your copy of ACFW you won’t see any updates. I highly recommend activating it!December 3, 2014 at 1:11 PM #746
Hey Daron – thanks for the heads up. After working on this for several hours, my client decided they didn’t like their idea for this widget so it’s now on the shelf. 😐 I got paid, but it’s still a bummer. Thanks for all your help – I’ll implement this again the first chance I get.December 3, 2014 at 1:15 PM #747
Ah. All good! Save it then! I may send out a couple preliminary emails about updates for the first few until I can implement something more like ACF that notifies users that their version is outdated even before they activate their license.December 7, 2014 at 5:41 PM #928bpartchParticipant
Couldn’t you add a class field to the widget then just wrap it in a div in the widgets template file?
<div class="<?php $class = get_field('class', $acfw); echo $class; ?>"> <h3><?php $title = get_field('title', $acfw); echo $title; ?></h3> <p><?php $description = get_field('description', $acfw); echo $description; ?></p> <img src="<?php $image = get_field('image', $acfw); echo $image['url']; ?>" width="100%" alt="" /> </div>
December 7, 2014 at 5:43 PM #929
- This reply was modified 5 years, 11 months ago by bpartch. Reason: add more text
You could, but then you have to specify if for each new instance of that widget. Not efficient if the client has to enter that stuff and they mispell the class or change it.December 7, 2014 at 5:46 PM #931bpartchParticipant
^^ hadn’t thought of that, i vote my response down. 😛March 1, 2015 at 6:28 PM #1891
If either of you is watching this, I just did a major refactor for how widgets are formed in v1.4
This will make adding this feature a piece of cake (more so than before).
If you got any other ideas, let me know!
- You must be logged in to reply to this topic.