Search

A new extension, "Zen Coding" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Here's a list of available shortcuts for each instance.

Examples

tm>par+if

is a shortcut for:

<xsl:template match="" mode="">
    <xsl:param name="" select=""/>
    <xsl:if test="">

    </xsl:if>
</xsl:template>

tn>wh>call>wp*3

is a shortcut for:

<xsl:template name="">
    <xsl:when test="">
        <xsl:call-template name="">
            <xsl:with-param name="" select=""/>
            <xsl:with-param name="" select=""/>
            <xsl:with-param name="" select=""/>
        </xsl:call-template>
    </xsl:when>
</xsl:template>

tm>choose+

is a shortcut for:

<xsl:template match="" mode="">
    <xsl:choose>
        <xsl:when test="">

        </xsl:when>
        <xsl:otherwise>

        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

form>fset>label*3>input:t.some.cool.classes

is a shortcut for:

<form action="">
    <fieldset>
        <label for="">
            <input type="text" name="" id="" class="some cool classes"/>
        </label>
        <label for="">
            <input type="text" name="" id="" class="some cool classes"/>
        </label>
        <label for="">
            <input type="text" name="" id="" class="some cool classes"/>
        </label>
    </fieldset>
</form>

Love it! Thanks! Now page template and utility editor seems to be much more usable

Good work. Also It would be great to run this on e or TextMate.

Good work. Also It would be great to run this on e or TextMate.

Unfortunately, the TextMate Bundles are using an incomplete zen_settings.py, as the original one seems to support it.

Thank you guys. For anyone looking for a comfortable way to write HTML/XSLT code without leaving the browser window, Zen Coding is quite a reasonable compromise. I guess some people might find it useful as text formatter too, even if Zen Coding can’t do the job all alone. That’s why I’m taking into account the possibility of a merge with some other formatters out there like Markdown or Textile. Does it sound good?

Note: I moved all the examples to the first message of this thread, as it seems like XML escaping is a bit “aggressive” inside the Description field of this site’s Extensions section.

For anyone looking for a comfortable way to write HTML/XSLT code without leaving the browser window, Zen Coding is quite a reasonable compromise.

Indeed. This is a great extension!

Zen Coding updated to version 1.1 on 1st of January 2010

I guess some might find it useful as text formatter too, even if Zen Coding can’t do the job all alone. That’s why I’m taking into account the possibility of a merge with some other formatters out there like Markdown or Textile.

In the end I went for another approach:

Version 1.1: A new setting should now appear in your preferences listing all textarea fields from your workspace. By choosing one or more of them, you will tell the extension which fields Zen Coding has to be enabled on.

Attachments:
zencoding3.png

Nice extension, will have to check this one out.

Zen Coding updated to version 1.1.1 on 12th of August 2010

Zen Coding updated to version 1.2 on 31st of August 2010

By the way, I’ve found the best reference to what Zen can do is the zen_settings.js file. The XSL-commands start around line 700.

Ah yes, it’s the same reference I use myself. It seems pretty easy to add new shortcuts and expandos so if you have any requests, please ask here! :)

A new setting should now appear in your preferences listing all textarea fields from your workspace. By choosing one or more of them, you will tell the extension which fields Zen Coding has to be enabled on.

Question: do you guys use this feature? Is there a case where you found it useful? I’m not sure whether to keep it or not in future versions.

As a side note, this extension is already compatible with Symphony 2.2.

Question: do you guys use this feature?

Barely. It tends to make things overly complicated or break things if you don’t update your extension to reflect DB scheme changes.

I was looking for a solution to that for my markItUp editor, haven’t found anything yet though. I imagined that the editor would ship its default initialization function (i.e. jQuery('textarea').editor()) that could be overridden by any other extension (i.e. jQuery('.section-name textarea').editor()).

Does JS provide a method for that?

Barely. It tends to make things overly complicated or break things if you don’t update your extension to reflect DB scheme changes.

Yes, that’s right. Thanks for your feedback!

Does JS provide a method for that?

Sorry Nils, I’m not sure I follow. Can you elaborate?

Can you elaborate?

For example: I download an editor. It ships it’s own initialization function:

$('textarea').initEditor({
    markdown: true,
    preview: false,
    allowdragndrop: true
});

But what if I want to change something in that editor just for this specific project?

I could edit the extension (very bad, breaks updateability) or write another proprietary extension that replaces that initialization with say

$('textarea.markdown').initEditor({
    preview: true,
    allowdragndrop: true,
    buttons: LINK | IMAGE | HEADINGS,
});

Clearly, I was wearing my XSLT-cap when I dreamed of being able to do this (priorities and overloading is so stupidly simple in XSLT).

I was wearing my XSLT-cap

You have one? I want one!

You have one? I want one!

Sorry, it only matches my head. :-P

One (not very clean) solution could be

var editorSettings = {
    selector: "textarea.markdown",
    settings = {
        preview: true,
        allowdragndrop: true,
        buttons: LINK | IMAGE | HEADINGS,
    }
};

jQuery(document).ready(function() {
    $(editorSettings.selector).initEditor({
        editorSettings.settings
    });
});

After loading this code, all other extensions could change editorSettings to suit their needs before document.ready is initializing the editor.

Zen Coding updated to version 1.2.1 on 18th of December 2011

This extension is no longer maintained. If you want to adopt it, please drop me a line.

  • No longer supports Zen Coding on section fields.
  • Added extension.meta.xml.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details