We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New fieldtype that allows you to create fields on the fly from the publish form

Development and Programming

Christopher Imrie's avatar
Christopher Imrie
57 posts
14 years ago
Christopher Imrie's avatar Christopher Imrie

Hi Guys, I’ve had the idea to do this for while, but only just recently made the time to prototype it.

Now, before anyone gets the wrong idea, this is NOT intended to replace the current predefined fieldgroup creation process. That will always be present, and in fact is still the best part of EE. What I have found is that EE is great for splitting up your content into reusable chunks, but the most important part of the page (typically the “body” or “article”) is put in a single field such as a WYSIWYG editor, even though it is most often the most complex!

A classic use case scenario is blogging about code. Frankly, using a WYSWYG / Rich text editor and embedding code snippets throughout the article is a nightmare, so decided to create a fieldtype that I could build my content in ‘blocks’ on the fly. On the front end, the content is combined and output from a single tag, as if you had only used a single field.

Here is a video of it in action (switch to HD and full screen it to see whats going on - apologies for the size!):

http://www.youtube.com/watch?v=FGhAx_E9iJs

Any thoughts would be great!

Chris

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
14 years ago
Mark Bowen's avatar Mark Bowen

Hi Chris,

That looks really really neat. Loving what you’ve got there so far.

Any thoughts would be great! Chris

Do you need any beta testers? 😉 (I’m free for testing if you do)

I totally get what you’re saying about code blocks and the like and to tell the truth I’ve not had a site yet where I’ve needed to do that so not too sure of the capabilities of WYSIWYG editors regarding that side of things.

Can they not handle it at all then? Does using <pre> and <code> not work in them then?

I really do like what you’ve got going there though and would love to test it if you do need any testers.

Best wishes,

Mark

       
Christopher Imrie's avatar
Christopher Imrie
57 posts
14 years ago
Christopher Imrie's avatar Christopher Imrie

Hi Mark, Sure thing you can test it. I’ll be releasing it for free, so will most likely post it to github and open source it. Just need to get it working a bit better and tidy up the code. I also want to add more content block types, so just need ideas. Aim thinking of incorporating a file select/upload block, and using the interface from my Remote Files Browser (find it on Devot:ee)

One of the reasons this works well with code is because the symbols copy/pasted into the code blocks can automatically be converted to HTML entities, and wrapped in code/pre tags on the front end. In my experience WYSIWYG editors tend to not play nice with the formatting of code, especially if you are dealing with HTML entities. They tend to converted back into their symbol counterparts, wrapped in p tags, or worse reformatted completely Plus you have to do it all in the source view, then switch back to WYSIWYG view.

       
Jeremy Latham's avatar
Jeremy Latham
74 posts
14 years ago
Jeremy Latham's avatar Jeremy Latham

Impressive! Looking forward to seeing this roll out.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
14 years ago
Mark Bowen's avatar Mark Bowen
Hi Mark, Sure thing you can test it. I’ll be releasing it for free, so will most likely post it to github and open source it. Just need to get it working a bit better and tidy up the code. I also want to add more content block types, so just need ideas. Aim thinking of incorporating a file select/upload block, and using the interface from my Remote Files Browser (find it on Devot:ee) One of the reasons this works well with code is because the symbols copy/pasted into the code blocks can automatically be converted to HTML entities, and wrapped in code/pre tags on the front end. In my experience WYSIWYG editors tend to not play nice with the formatting of code, especially if you are dealing with HTML entities. They tend to converted back into their symbol counterparts, wrapped in p tags, or worse reformatted completely Plus you have to do it all in the source view, then switch back to WYSIWYG view.

Excellent news. Can’t wait to give this one a run. Looking forward to when it’s online.

Best wishes,

Mark

       
Dylan Smith/Context Design's avatar
Dylan Smith/Context Design
346 posts
14 years ago
Dylan Smith/Context Design's avatar Dylan Smith/Context Design

Howzabout a 1.x version for those of us still keeping it old-school?

A file block would be cool, and a raw block, where code doesn’t get converted to entities, but output just as you entered it.

       
Hue Labs's avatar
Hue Labs
31 posts
14 years ago
Hue Labs's avatar Hue Labs

Christopher, this is amazing. Mixing javascript and css within WYSIWYG editors has always been an issue. Post here when you’re ready for beta testing sir!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.