subbes (subbes) wrote in component_help,

Creating New Functions?

Possibly a stupid question, but: I'm adding the "full update" component to my LJ style, and I would like to put the entire thing into a new function so I can call it from within my already-edited print_free_text but keep it from becoming too bloated.

When I attempt to compile my (theme) layer, I get the following error:
Compile error: Only core and layout layers can define new functions.

(So, we appear to have at least four types of layers [core, layout, user and theme] in s2, unless the compiler is giving me a mislabeled thing).

But anyway. Given this error, I'm inclined to believe that I cannot create a new function. Yet I could have sworn I've seen tutorials in here that involve creating new functions.

Am I, perhaps, crazy? If not crazy, how can I create myself a function? Putting everything into print_free_text makes my hackles raise due to an intense dislike of bunging things in there when they should be functions of their own.

Erm. Illumination? Explanation? The S2 documentation has not shed any light upon this issue for me (but then again, it doesn't shed much light about anything for many people).

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened