-
Notifications
You must be signed in to change notification settings - Fork 862
Foundation Shortcode Buttons In WYSIWYG Editor #599
Comments
Could be very interesting, what do you think the best approach would be? |
None of the Foundation Shortcodes plugins look like they support Foundation 6 yet. At the very least some shortcodes for rows and columns would be nice. |
Totally, I find myself need buttons in the editor so maybe starting with the essentials like layout and certain much-used UI elements? |
Wordpress has a great engine for implementing new buttons into the wysiwyg interface, and translating it into shortcodes, which can then spit out HTML on the frontend. Typically once the user has clicked on a button a modal pops up revealing several options. For example if you wanted to implement a "grid" within the content of a post, which is something I want to do frequently, a modal would pop up asking what you want the breakdown to be. How many columns? What size? What order? Do you want to push/pull any of the columns? The list goes on... This is where I get a bit queasy about the idea. Lot's of variables... I would struggle with the interface within the modal, but I could handle most of the registering and rendering of shortcodes. |
To keep things simple we could build it without the WYSIWYG interface to begin with, and then add that in later. |
@colin-marshall, what do you mean? I was thinking we would just implement it into the WP Post Editor. |
Sorry, that was definitely confusing the way I worded that. I meant we could start by adding the functionality where you type the shortcodes into the post editor manually, without a button that pops up a modal with a form in it. I thought that's the part you were saying would be the most difficult, so I was suggesting that we could add shortcodes without that to begin with. |
Grid, Done! I went ahead and made a proof of concept on My Fork of FoundationPress. You'll find a folder in the library called The example below will create a grid with two columns, the first 4 columns wide, and the second 8 columns wide. Currently the column shortcode will support width attributes
I like the idea of keeping this all conained within a folder in the library so that projects that have strayed too far away from the FoundationPress origin to merge updates can still grab the folder, plop it in their library and pull it into their functions file, assuming they are running Foundation 6. |
tried it in my fork. and works. nice addition. |
Nice work @josh-rathke! I'll test it out when I get a chance. One suggestion would be to change the text you use for the column sizing. Could we just leave off the word "width" to make everything shorter? The post editor can get really messy when using a bunch of shortcodes.
Also, I've seen shortcode attributes before that don't use equal to. Not sure how it's done, but if you did it that way you could make it match Foundation's classes like this:
What do you think? |
I did think about leaving off "width", but then I realized that the width is the first of many attributes that will need a screen size associated with it. For example what if I wanted a 4 column wide column that was offset by 2? You would need something like: I think getting offsets and push/pull would be a pretty solid foundation to have as a starting point for making this really useful to an end user. In terms of using the format |
Okay, I went ahead and implemented some more features along with merging some suggestions from above comments, which by the way were great! Thanks to everyone who contributed so far, it hasn't even been 24 hours yet! I went ahead and made the "width" attribute as simple as @colin-marshall This Article will interest you! In order to achieve column centering I implemented what is known as an "unnamed attribute", meaning it doesn't necessarily have a value attached to it. These are stored in the attributes array using an array key which makes them difficult to retrieve unless you process them first and replace the key with something that won't be so dynamic such as a string, at which point you can treat it like a boolean operator. So centering works like this |
Again, great work @josh-rathke! Thanks for digging up that article on unnamed attributes. I actually found it myself a couple hours ago. I came to the same conclusion you did about how it would require processing to get the unnamed atts working with column widths. It definitely makes more sense to set the attributes to a value for the column widths, while something like When you said |
Yep, totally meant |
I guess the functionality is there now. The hard part is going to be figuring how to pack all of this into an easy to use interface. I don't see it being too fancy or anything. |
Hey Guy's, I have given this some thought and I really think it could be a huge feature to have in FoundationPress. That said, I still would want @olefredrik to weigh in on it, and if it's a "Yes, let's pursue it", doesn't anyone know what the best way to develop a feature like this would be? I am fine with using my Fork until we think it's ready to merged into the primary FoundationPress repo, but even in terms of collaboration what would be the best? Continuing to use this issue as a communication point will get messy eventually. |
If @olefredrik thinks this is worth pursuing, it would probably work best if he made a shortcodes branch for us to develop on. I'm not sure if it's possible for me to contribute to your fork since I can't make a fork of your fork. |
I think a new branch would be the easiest. I don't really anticipate As a developer I get excited about the idea of not having to develop custom Josh Rathke On Sat, Dec 12, 2015 at 4:40 PM, Colin Marshall notifications@github.com
|
@josh-rathke @colin-marshall : Shortcodes for the most commonly used components, is in my opinion a very useful feature to have. How much freedom and flexibility we would want to provide to end users, is a very relevant question. Therefore, I believe that additional nice-to-have functionality should be developed as plugins (bundled with FP or stand-alone). It makes sense if short code functionality is an embedded part of the theme. Developers who want to restrict end-user's creativity, can just remove the include statement for shortcodes in So let's do this!? I have created a new development branch, which is up to date with the current master branch. If you submit pull requests to the development branch, we can merge that branch into master when we're ready. If this is done right, and simple enough (for the end-users), I believe that it is something that will lift FP to the next level. |
This sounds nice! I once added some buttons to the simple text editor, so not the wysiwyg editor. The once I mostly use are the button for flex-video and one for Alerts. |
@josh-rathke: I made a little Roadmap so we can track our progress on the shortcodes @ https://github.com/olefredrik/FoundationPress/wiki/Roadmap. Feel free to modify it where you see fit. After adding TinyMCE functionality for buttons I realized that we will need to break up the javascript into modules/separate files for each shortcode component. We can definitely do this with Browserify, or RequireJS. I'm not sure if it's possible, but ideally I would do this with Babel and ES6 modules. I have yet to figure out if that will work client-side though. Any thoughts? |
@colin-marshall This is great! Sorry I haven't had much time to contribute to this thing. I'll have a little bit of time here and there throughout the holidays to mess around a bit. It looks like this is coming along nicely. |
I'll add this to the roadmap, but responsive video would be one I would use a ton! |
@josh-rathke did you see that @olefredrik recently added flex-video classes to the automatic embedding of videos from youtube and vimeo? Commit: 5158a3d |
Sweet! @olefredrik out of curiosity do we have a list of all of the ways we I am not trying to gripe about anything at all. But it seems like in a On Saturday, December 26, 2015, Colin Marshall notifications@github.com
Josh Rathke |
My only concern is that FoundationPress remains a turnkey development On Saturday, December 26, 2015, Josh Rathke josh.rathke@ywammontana.org
Josh Rathke |
I've long suggested that cleanup.php needed an overview (or just plain removal) but to be fair this is not a new file or feature creep, it has always been part of FoundationPress, it has been there since the first commit (and most of it came for another theme, Reverie). I you wan't a truly stripped down version of FoundationPress you could do as I do; fork it and remove all the functions, extra styles, templates, languages and other stuff you don't need (or don't agree with). As the usage of FP has grown many different people with different need have had their suggestions and PR with additions and changes added to FoundationPress, sometimes accidentally introducing bugs and code that was added by mistake. If you have your own fork then you can pick and choose what changes you really want more carefully. |
Hi Everyone, please how can one see a demo(or any site its been installed on) of this theme..I am actually looking for something like this http://www.pressroomvip.com/ |
As for adding a fancy UI around the short codes, has anyone considered https://github.com/fusioneng/Shortcake as the framework for a more use friendly interface? |
I really hate shortcode but they are very useful, so I think the "shortcake" way is a nice way to use shortcode! :) |
@josh-rathke @colin-marshall @olefredrik The Easy Foundation Shortcodes plugin is excellent, with the exception of a few quirks and typos. It only works with Foundation 5 but it would be a great model for what this would look like. For the effort involved, I would suggest decoupling shortcode functionality from the theme and developing it as a plugin so it could be used with other foundation themes, (since all it will do is generate markup). It could still be called FoundationPress Shortcodes or something. I've used EFS on at least a dozen sites and users typically don't have any problems working with it. It's got shortcodes for the grid, flex-video, buttons, tabs, accordions etc. and they all display a modal with options when the button is clicked in tinymce. |
@joshrathke Just ran into this when googling for ideas for a simple solution for Foundationpress. Something with just colums. I didn't see a development branch or anything official in the FP repro, so went over to the branch you mention above. Is this the latest work done? Just checking. Thanks. |
Are you wanting to be able to select the number of columns in the content editor? If so I've been using ACF plugin and making flexible layouts with a select drop down, then defining a few layout styles in the template using foundation column classes. |
@nitrokevin I actually built an initial ACF sections with the same idea that I use. However, I am working on a project where they want me to convert these whitepapers to posts. The whitepapers switch from 1 column to two colums throughout the post. So my thought that it might better to use shortcodes. Now you have me thinking it over again : ). |
For that you probably wouldn't need the conditional part, you could just make two flexible content layouts and let them select the layout |
@nitrokevin You got me thinking about using ACF again. However, this shortcodes thread is interesting and worthwhile. Thanks. |
As it's been a year and a half since this issue was opened, and there has not been any progress recently (no blame), I think it's fair to close this. If you ever get time to continue where you left off, I will be more than happy to review any pull requests. :) |
Just a heads-up to all of you who have been waiting for shortcodes for Foundation in WordPress. I've been talking to a web dev who has developed a WordPress plugin with Foundation 6 Shortcodes for Visual Composer. It's a premium plugin currently priced at $15. I don't have first hand experience with the plugin, as I don't use Visual Composer. But I guess it's probably good value for money, compared to writing your own plugin (unless your super fast and very skilled at writing plugins, of course). |
Hi all, I'm the developer, feel free to ask any questions you may have. Just an FYI, even if you don't use Visual Composer you can still use the shortcodes by manually inserting them! |
There are a couple plugins that already do this, but from my experience they are clunky to install and in some cases come with another version of Foundation to guarantee functionality, which can cause some styles to be overridden in the front end.
Would anybody on here want to join forces and do a proof of concept for adding a few basic layout features of Foundation to the WordPress Editor within FoundationPress? I think it would really take this theme to the next level if we provided some basic interface between the end user and Foundation.
The text was updated successfully, but these errors were encountered: