Joss Posted February 9, 2013 Author Share Posted February 9, 2013 Okay, just to add a little more On the existing image field, I was wondering about being able to do two things: 1. adding a class to either the image or the <a> tag if you are linking. This would enable me to type "fancybox" to get that to trigger. Although you can do this on TinyMCE, it is fiddly - quite often it will simply add the class to the P tag and you end up having to edit the source. 2. Saying what attribute you want the "description" to be added to - alt, title or none (default). Joss Link to comment Share on other sites More sharing options...
ryan Posted February 10, 2013 Share Posted February 10, 2013 I plan to upgrade the image and link dialogs to account for more attributes. Definitely a class attribute, though hadn't considered a title attribute (wouldn't that go on a <a> tag instead?). As for making alt an optional attribute, that's not planned because it's required by XHTML (even if it's blank). Link to comment Share on other sites More sharing options...
Joss Posted February 10, 2013 Author Share Posted February 10, 2013 Yep, the A tag, normally - at least for fancybox. Yeah, I know alt needs to be added - it was more what you wanted in it. The trouble is there could be a lot of variations here - don't want to make the attribute section too long. So perhaps: Text box for image alt + plus check box if you want the description to be used instead of the text box. (checking it grays out the text box and makes it read only?) Text box for image class Text box for associated <a> title tag (only available if you have made the image link to larger version), + check box if you want the description to be used instead of the text box. (checking it grays out the text box and makes it read only?) Text box for <a> class (only available if you have made the image link to larger version) Er, anything else? (Brain is mush this morning) Link to comment Share on other sites More sharing options...
diogo Posted February 10, 2013 Share Posted February 10, 2013 Why not let people add fields on the image field options? 1 Link to comment Share on other sites More sharing options...
ryan Posted February 12, 2013 Share Posted February 12, 2013 Text box for image alt + plus check box if you want the description to be used instead of the text box. (checking it grays out the text box and makes it read only?) But then how to get the dynamic description into the static HTML from TinyMCE? It would have to be done at runtime with some kind of variable replacement. That's something I've been trying to avoid with TinyMCE, though don't have good enough reasons. Text box for associated <a> title tag (only available if you have made the image link to larger version), + check box if you want the description to be used instead of the text box. (checking it grays out the text box and makes it read only?) One of my problems with the default dialogs in TinyMCE (and most other editors, for that matter) is that they present every possible option and only a developer would understand the vast majority of them. For instance, the distinction between a description and a title is going to confuse the non web-developers. I tend to think we should just make the behavior a checkbox in the module's configuration rather than the image editor. Another thing to consider is that we'd be duplicating an 'alt' to a 'title' for the benefit of javascript. When faced with that, it's technically more efficient to duplicate the attribute in javascript rather than in the markup, i.e. $(document).ready(function() { $(".gallery a > img").each(function() { // copy image 'alt' attribute to a 'title' attribute $(this).parent('a').attr('title', $(this).attr('alt')); } }); Why not let people add fields on the image field options? Do you mean add attributes? Not possible at present, just because our JS-side of things needs to know what the attributes are ahead of time (though some re-coding could solve that). But since these tags only accept a limited number of attributes anyway, I'm not sure we need that scalability here. Link to comment Share on other sites More sharing options...
Joss Posted February 12, 2013 Author Share Posted February 12, 2013 You can sort of do a workaround as Diogo said by adding an "addClass" to the template, then using a text field to say what the actual class is - but this is a bit eye-bending and I think it helps with images that when you are doing the "insert image" action, that is the point you are asked awkward questions and not somewhere else on the form. I get your point about not making it too confusing. In an ideal world, you would have a button that said "press this if you want a big version to open in a lightbox" and the rest is done automatically. But, as you say, that means that the WHAT is done automatically and so needs to be set earlier; probably in the image field configuration, giving the dev enough options for their particular dancing image popup system. Of course, that would also lay the ground work for some of the other future image settings Link to comment Share on other sites More sharing options...
diogo Posted February 12, 2013 Share Posted February 12, 2013 I think I missed the point of the discussion... I didn't think you were talking about tinyMCE, but the image field module, and that you were planning to add more fields besides the description field. So, what my "Why not let people add fields on the image field options?" meant was that the image field could be expanded to accept the addition of fields on the image field admin, just like a repeater. Does this make sense? Link to comment Share on other sites More sharing options...
Joss Posted February 12, 2013 Author Share Posted February 12, 2013 Ah, yes, now that I can see that you were having a completely different conversation, it makes perfect sense! Link to comment Share on other sites More sharing options...
ryan Posted February 14, 2013 Share Posted February 14, 2013 So, what my "Why not let people add fields on the image field options?" meant was that the image field could be expanded to accept the addition of fields on the image field admin, just like a repeater. Does this make sense? Easier said than done. It's a good idea and a regular need. If it were easy, we'd have already done it. Link to comment Share on other sites More sharing options...
Joss Posted February 14, 2013 Author Share Posted February 14, 2013 Easier said than done. It's a good idea and a regular need. If it were easy, we'd have already done it. Can I misquote you on that? "We have already done it, so it must have been easy!" As good a marketing line for using PW as a site builder as any I can think of. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now