Timeline for Processing shortcodes in groups (separated by line breaks)?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 11, 2013 at 2:39 | comment | added | Austin | Yes, unfortunately any combination of images into a single tag (even just the IDs) will effectively "fasten" them together and break drag-and-drop. I really do appreciate the thought you've put into this, though -- thanks! :] | |
Feb 11, 2013 at 2:38 | comment | added | Austin | Masonry looks really neat! But it wouldn't help in this case, unfortunately. My plugin layouts will be fixed-width and won't change when the browser window is resized -- but they will adapt to many different blogs with different themes and page widths (or within a single blog if the theme is changed). When the blog width changes (rarely), it's not the number of images in the row that will change but the actual size of every image. (I am not simply setting width/height attributes in the tag, but actually requesting specific image sizes "on the fly" from the host, SmugMug.) | |
Feb 11, 2013 at 1:31 | comment | added | birgire | another idea would be to use [imgs id="12,23,34,45"] with only the id attribute and then add a metabox with more detailed info in json/xml/csv/shortcode format, for example : id,w,h \n 12,200,300 \n 23,400,600 (but maybe your drag/drop idea rules this out?) | |
Feb 11, 2013 at 1:14 | comment | added | birgire | Some grid jQuery plugins (like Masonry: masonry.desandro.com) do this kind of image fitting you describe in your question, so maybe you could simplify your project by moving some part to jQuery? So you wouldn't need to do the fitting in php - just another idea ;-) | |
Feb 10, 2013 at 21:33 | comment | added | Austin |
Thanks again, birgire -- I've just clarified the question a bit. A nested tag structure wouldn't be ideal for my purposes, but I might consider it a passable "second-best" alternative. It would still present challenges to implement. Wordpress would jump into the [imgrow] shortcode, and I could pull out the [img] tags with $content , but I would still have to manually parse that string of tags to fetch the attributes and compute sizes before I could dump them recursively back into do_shortcode() . Does that make sense? Might be best to move this idea to a separate answer...
|
|
Feb 10, 2013 at 21:20 | comment | added | birgire | ok, but what about this kind of structure: [imgrow][img][img]...[/imgrow] ? | |
Feb 10, 2013 at 19:40 | comment | added | Austin | I've considered this, and while it would technically solve the issue, it makes the rows very inflexible. For my application I occasionally need to be able to drag-drop reorder the images between rows, and this would make that impossible. Also, I used simplified shortcodes in my example -- they actually have seven attributes, one of which (caption) is often quite long. Combining three, four, or even more images in one shortcode like this would become very unwieldy. But thanks for the suggestion! | |
Feb 10, 2013 at 11:36 | history | answered | birgire | CC BY-SA 3.0 |