New To S2

Mar 29, 2006 15:29


Hi All :) I am looking for a tutorial / how-to for creating my own top-level layer (not a layout-specific or style layer).

I'm new to the idea of customizing my liveJournal and I want all in. I have the HTML and CSS for the layout I want. I've browsed the S2 Manual and I've learned the most from looking at the public layers but I am still somewhat ( Read more... )

Leave a comment

Comments 8

camomiletea April 4 2006, 16:17:37 UTC
I'm not a programmer, but here's what I found: you can define any sort of global function, I have for example 'print_random_userpic(Page p)', 'authorization', 'print_custom_links', 'replace_text'.

But if you want some function in an existing class from Core (not one you define yourself, apparently), you should prefix the name with "lay_"; a lot of styles also use prefix "lay_print_". I have a function named:

function Page::lay_spammertop() {}

And it works okay. It counts how many times someone's name appears on my friends page and prints the top 5.

I'm not sure what you are talking about concerning "function calls", so I'll leave that to programmers ;)

Reply

ravenchyld April 4 2006, 21:33:29 UTC
That makes total sence. Thank you :)

Reply


kunzite1 April 4 2006, 20:13:08 UTC
if you're trying to invent your own functions in a theme or user layer, you'll get compiler errors since those layers are specific to a layout.

if you create a top-level layout layer, you'll be able to define your own global functions and use the lay_ prefix to create your own class-specific functions, just as camomiletea stated.

function Page::lay_print_header() exists in flexible squares but not the core. function Page::printHeader() does not exist in any layer. nor does function printHeader(). however, if you created your own layout layer, you would be able to define function printHeader(). however, you would be unable to define function Page::printHeader(). instead it would have to be function Page::lay_printHeader().

after all that... it would be much much easier to see if you could hack an existing layout into something that resembles your layout in mind.
i say this because there are many more things to a layout layer than just the structure of the layout. you also have to define the properties that you're going to use. and that ( ... )

Reply

kunzite1 April 4 2006, 20:14:47 UTC
naturally, i failed to remember to add urls to those links.
here are flexi and the core.

Reply

ravenchyld April 4 2006, 21:32:31 UTC
That makes sense :) Thank you!

I half heardedly followed your link to the core only to discover that I've never scrolled down far enough to find the information I really wanted *palm meet forehead* My tags aren't labled as tags anymore :)

What I started off doing was copy and pasting flexible squares code onto a top-level layout layer and then hacking away at it but once I had the basic understanding of what was going on I began my own layer so I could define my own properties. Once I stopped trying to use flexable squares code I ran into the naming confusion. Anyway I'll remember the lay prefix :)

The work in progress is up as my current layout. It displays best in FireFox right now (my browser of choice, but I want it to look right in all eventually). Most of the major stuff is there but a few pages are missing footers and the view entries by subject page hasn't been formated yet.

Reply

kunzite1 April 4 2006, 22:09:03 UTC
What I started off doing was copy and pasting flexible squares code onto a top-level layout layer and then hacking away at it

well. if it's going to look mostly like flexi, why not start with flexi and override the functions in a theme layer that you need to change?

I began my own layer so I could define my own properties

what kinds of things did you need that weren't available?

if you're working in a user/theme layer and want to create your own functions, you can, but it's tricky.

you seem to have view_entry_disabled set to true so that it uses bml pages for entry/reply view. if you set it to false, you should be able to see the s2-styled pages.

in flexi, EntryPage::print_body() calls print_entry() but ReplyPage::print_body() doesn't have the same function call because you can't send a Comment object to the print_entry() function with the way that it's written.

so yeah. you might be able to get away with just hacking up flexi to suit your needs.

Reply


Leave a comment

Up