[personal profile] marahmarie posting in [community profile] style_system
Many Dreamwidth s2/Core2 styles have the "back to top" link at the bottom of the Recent Entries view, but Transmogrified doesn't. I had the same problem on LJ, when I used the Bloggish layout with a custom style sheet and theme layer, but I couldn't solve it, not even by modifying s2 Mixit's code to fix the problem, because Bloggish lacked a "back to top" link in the HTML to hook the s2 to.

So my question is kind of two-fold:

Is there any way to get all the proper HTML (including the necessary but missing HTML links and the requisite s2 to make it all work) into Transmogrified, and if so, how?

Because my other problem is I cannot figure out how DW's s2 differs from LJ's version of it. So I would need someone to work out the code for me but hopefully someone who could also explain how s2 differs on DW from LJ's version (or at least point me in the right direction, if there's something I can read on that to make it more clear).

Because the way I figure it, if I can't read (that is, understand) the s2 on DW, I'll never be able to modify or write it. And I want to be able to do both.

Date: 2010-11-29 08:01 am (UTC)
foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
From: [personal profile] foxfirefey
Easiest way to fix this probably is to override Transmogrified's Page::print() function in a theme layer:

function Page::print()
{
    """
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>""";
        $this->print_head();
        $this->print_stylesheets();
        $this->print_head_title();    
    println "</head>";
    $this->print_wrapper_start();
    $this->print_control_strip();
    """
            <div id="container">
            <div id="top"></div>
            <div id="header">
    """;
    """
                <a name="top">
    """;
    $this->print_global_title();
    """
                </a>
            </div>
    """;
    $this->print_module_section("one");
    """
            <div id="wrap">
            <div id="content">
    """;
    $this->print_body();
    """
            </div>
    """;
    $this->print_module_section("two");
    """
            </div><div style="clear:both;"></div>
        </div>
        <div id="footer">
    """;
    $this->print_module_section("three");
    """ <div class="top"><a href="#top">Top of Page</a></div>
        </div>
    """;
    $this->print_wrapper_end();
    """
    </html>
    """;
}


You can see the original function here, I only added two lines to it:

* One to add the <div id="top"></div> to make it use #top like the other layouts, above the #header div.
* One to add the <div class="top"><a href="#top">Top of Page</a></div> at the bottom of the footer, so you can style it how you like.

You can, of course, tweak with this--put the code in different places, etc.

Now, I realize you're probably going to need more information than just this, but I'll need to know where to start explaining-- Have you ever made a theme layer before and then used it in a style? If not, that is probably where to start!

Date: 2010-11-29 04:39 pm (UTC)
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)
From: [personal profile] matgb
Don't appear to need to [div id="top"] bit, for some reason it's got coded [a name="top"] up there already, so only need to put the bottom link in there.

I can't see why it's not actually there though, very strange to have it in every other style, was transmog the first non tabula layout?

Date: 2010-11-29 04:41 pm (UTC)
foxfirefey: Fox stealing an egg. (mischief)
From: [personal profile] foxfirefey
Ah, thanks!

Yeah, it was. Not sure if I shouldn't add it or if that would be TOO DISRUPTIVE or what.

Date: 2010-11-29 04:45 pm (UTC)
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)
From: [personal profile] matgb
I cannot figure out how DW's s2 differs from LJ's version of it

The S2 itself doesn't differ. The difference is in the basic core layer, which does have substantial changes to it, which overall make it a lot easier to understand, and negate the need to reinvent the wheel regularly, unlike on LJ where so many different layouts do the same thing in differing ways in a confusing manner.

The styles team put a lot of work into making the basics right so we can build on it much easier, I've found learnign S2 on DW a lot easier, so I can now look at LJ code and figure out what it's doing, whereas before 'twas all Greek.

Essentially, in the advanced layer browser, Core1 is LJs S2, Core2 is DWs S2, and reading Core2 with the stuff on the Wiki should get you most of the way.

Date: 2010-11-30 08:54 pm (UTC)
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)
From: [personal profile] matgb
See, I could never, ever, get my heqad around what was going on on LJ. And if I ever did, if I switched layout (from, say, Bloggish to Expressive), then you had to start again from scratch as each layout pretty much reinvented the wheel, LJ had a series of different layer engines, each getting semantically better as time went on, but all of them had a very cobbled together feel.

Start with Core2, read it through, the code is fairly good (for example, have a look at the base Tabula Rasa layer and see how little is needed to make a layout work). IF there's stuff that's not commented or clear, that sort of counts as a bug, but may be better solved in the how-tos.

BTB, I don't think you need to include the third function (given that the code looks Very familiar), it doesn't affect the page display.

Effectively, we have got a new sort of S2, but only because they went back to first principles, figured out what the thing could do, and made it much easier to do it. Some of the end results are, unfortunately, stylistic choices I disagree with (like the way header TITLEs are done by default), but they're all easily fixed.

Profile

Dreamwidth style system discussion

April 2025

S M T W T F S
  12345
6 78910 1112
13 141516171819
2021 2223242526
27282930   

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 8th, 2025 01:59 am
Powered by Dreamwidth Studios