Update: HTML block is now available.
The Wikidot Community is very creative and can use features that programmers develop in a very clever way. Here they explain how to embed custom HTML into Wikidot pages. As you see it's possible, but quite hard. But most importantly that page showcases the resourceful community and how powerful Wikidot is.
My name is Piotr Gabryjeluk, I work for Wikidot Inc. as a programmer and designer. And from now on I will also write on blog.wikidot.com to keep you up to date with development status and to share ideas of improvements that the development team has.
With the addition of data forms Wikidot becomes one of the most interesting wiki platfarms (platform + farm) on Earth. Using ListPages, Live Templates and Data Forms we allow (almost) regular folks to create applications like CMS1 for their co-workers, clients or friends. Things usually done by programmers are now available to regular users without need to find proper hosting, choose a web framework or write a line of "proper" computer code.
What I find most interesting in building applications on Wikidot is that the platform itself is quite bullet-proof. I mean when you forget to put a semi-colon at the end of a line, you don't get your application crashing because of a syntax error2. Moreover when making an application with Wikidot you get storage with history and e-mail notifications about changes for free, which makes your data safe. In case someone attempts to destroy your site you are informed about this by e-mail so you can just revert back to the right version.
But Wikidot applications are not the most important thing Wikidot is used for. Many sites on Wikidot are just plain wiki sites with links to store and share knowledge within certain groups. They don't use advanced features like modules, includes, templates. They usually just edit and save :-) from time to time uploading some file or image. What we want to do is to review all common operations people do most often and (really really) simplify them. Sophisticated applications are worth nothing if basic usage of service is not easy.
We want to simplify doing things people need like embedding HTML mentioned at the beginning of this post. Instead of creating a hidden code block and embedding it as a frame, choosing proper height, deleting borders, etc…, it should be as easy as this:
[[html]] <h1>Custom HTML</h1> <p>Something else</p> <img src="anything.png" alt="hello ;-)"/> [[/html]]
This code will just inject the HTML (including JavaScript) into the page in that place. Making this as simple as this and keeping this safe for your site, means quite a lot work — in fact, we need this content in a separate frame, that auto-resizes to keep the content fitting inside.
The original idea of the [[html]] tag comes from James Kanjo (Iframe module design proposal). Then it was fine tuned on the projects forum by the Wikidot Community.
We have a bunch of other fresh ideas, which we'll be sharing on blog.wikidot.com in the future.
EDIT: As we've been experimenting with this feature in our free time during last weekend, we've been able, to implement this really quickly. I mean, yes, it's live :-).
HTML blocks would be useful for new users that understand HTML but do not (yet) understand the Wikidot language. Implementing this feature would definitely be a good step towards giving new users a smaller learning gap.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I agree that HTML blocks would be a good thing to add. I probably wouldn't use them much now hat I've gotten used to Wikidot syntax, but they certainly would have been welcome when I first started using Wikidot a year and a half ago.
Wayne Eddy
Melbourne, Australia
LGAM Knowledge Base
Contact via Google+
This would certainly save the endless "use a codeblock/iframe combination" solutions that we've given every week for the last 2 years.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Developing HTML code blocks is genius. I've used the work around, but it is quite complicated to remember the steps. I can't wait to try this simpler method out, and will probably regularly incorporate it into my wiki use.
I didn't realize it was live! I just tried it out and it works fabulously.
Any thoughts on how or whether this will someday interact with user-created style sheets? These styles obviously not controlled by the site's CSS style sheet, so will you have to create custom CSS styles for each block (as it looks the case now)?
Anyway, I'm happy just to be able to do this so easily. Thanks, Wikidot!
Just glanced back at the code. If I add a class "internal-style" to my CSS, will that control the default style for HTML blocks in my site?
Well, it has been pushed just a few minutes ago actually.
Yes, now every block needs to have it's own built-in CSS stylesheet OR you can always use one external stylesheet by using in html code:
Excellent. This works very well. I've just deliberately tried it on my page with lots of Google Visualizations and it was very quick and worked perfectly.
So the blog post where it says "it should be as easy as this:" is out of date as the functionality has been delivered a mere 2 hours later :)
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
As we can see on your page [[html]] is a nice replacement for the old [[embed]] tag, but one that accepts just every HTML ;-).
Piotr Gabryjeluk
visit my blog
Actually, yes. Now [[html]] can be used as a replacement to [[embed]], but it differs in the following:
Moreover, since html sandboxes the code, you can actually run your own scripts within it. At the moment your scripts do not have access to the main document page (perhaps this could be solved somehow), but I believe it should already provide a nice toolset.
Michał Frąckowiak @ Wikidot Inc.
Visit my blog at michalf.me
Excellent. I just updated/cleaned this page http://community.wikidot.com/test:javascript-ega-handicap. Perfect !
Yes, excellent indeed!
I just created a new CSI to make it easy to use the free overLIB javascript library. I proposed a design sketch back in September of 2009 to make this library part of Wikidot syntax, but this is a good way to implement it unless or until that design is considered.
Nice going! Thanks for pushing this out.
-Ed
Community Admin
Did you have any problems with this Ed? In a couple of tests today jQuery, for example here, stubbornly refused to work inside the new [[html]]..[[/html]] tags.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
No, I just copied what I had done in a code block/iframe previously and placed it in the html block and it worked as advertised. The CSI really does nothing more than split the html block between the </head> and <body> tags, with the CSI holding the the top portion of the code and the user supplying the <body> tag and everything below.
-Ed
Community Admin
Rob,
After looking at your code, it turns out I did have the same problem you ran into. Your JQuery code actually works inside the [[html]]...[[/html]] block. The problem is that the sandboxed iframe that the HTML code block is housed in is only 1 row of text high. Clicking the "menu" link won't expand the iframe size, so the solution is to wrap the <body> … </body> inside a div that explicitly sets the height or sets a min-height. I'm sure you'd see similar behaviour if you didn't specify the height of your iframe. In my overLIB example, I had to add a few <br />'s at the bottom of the page to extend it so my pop-ups near the bottom of the page wouldn't get cut off.
I just did that on your test page.
Community Admin
Thanks Ed. I hadn't investigated it beyond "oh, it doesn't work with jQuery", so thanks for doing the hard work :)
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
I've just tried it on another bit of jQuery code for a slideshow and it does work well wrapping the body in a div with a min-height property. Thanks.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
HTML has been my second language since 1996, I thought it was useless now. You have no idea how happy I am 'sniff. I promised myself I wouldn't cry. I love you wikidot. I guess we can easily use any stat counter we want now. You've opened the door up for so much more freedom.
This almost meets my requirements to be useful for my Wikidot Apps… I require an option to make the iframe contain a specified hash reference.
Please read this: HTML Block Attributes
It shouldn't be difficult to implement