Timothy Foster has been working on a project to create and organize some CSS snippets (example: Minimized Login Status). He is using data forms to organize things, but the problem is that trying to import the CSS code snippet using
@import url('http://css.wdfiles.com/local--code/cssnippet:minimized-login-status');
results in a "No valid codeblock found." error.
I understand that this is likely due to the fact that data form pages are stored differently than standard pages. What I'd like to see is a way to support using code blocks in data forms that can be accessed via the URL. I would suggest forcing us to use strict rules like limiting us to a wiki field type and requiring the field to start with [[code type="<code type>"]] and end with [[/code]] to make it easier to parse. Something like this:
[[code type="css"]]
/** Minimalized Login Status
* Developed by the Wikidot Community
* Minimalizes the Login Status so that it only shows the user's avatar and
* behaves like a button.
* ***************************************************************************/
/* * When Logged In * */
.login-status .printuser{ font-size: 0; }
.login-status .printuser img.small{
max-width: 20px !important;
padding: 0 !important;\n
...
...
}
[[/code]]
Is this something that could be added to the parser?
I always thought, code blocks are "numbered" inside a page ? Is this here on dataform pages the same ?
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
This was indeed something that had me scratching my head for a while. In its current state, creating code blocks in a dataform does not result in a local--code page. However, Wikidot has allowed the formation of local--code pages from live _templates (as documented). Therefore, if a particular field consists solely of code, wrapping its raw form in [[code]] blocks in the live _template pages will in fact produce desired code pages. This is how I got the CSSnippets to work.
Also, in the current state you can tell wiki fields to encase things in code blocks using default: '[[code]]\n\n[[/code]]'. However, it isn't forced (the user could always remove the code block).
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
Now I'm scratching my head. It doesn't appear to be working. I posted a message about this on the Bootstrap Playground. After doing some digging and testing, I thought I figured out the issue. That's why I posted this wish. Am I missing something?
Bootstrap Playground - Wikidot Meets Twitter Bootstrap!
Wikidot API - PHP · A PHP client and code samples for the Wikidot API
After re-reading the docs, I tried a different syntax for accessing the code block.
This does not work (or any variants that use "local—code" syntax):
This does:
And I see that the csssnippet template does indeed display the correct syntax. It was the invalid "local—code" syntax on the Bootstrap site that was tripping me up.
Rejecting this wish since it's not needed…
Bootstrap Playground - Wikidot Meets Twitter Bootstrap!
Wikidot API - PHP · A PHP client and code samples for the Wikidot API