Porting a G1 theme to G2... I did it, but don't remember how

WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Wed, 2011-08-10 03:40

I remember a couple of years ago there was a site that would do this for you. You put in your html and whatnot and it handed you a G2 theme. I'd love to find that site again.

Also, is there anything similar for G3? I'd like to upgrade but my theme is complex and I don't know that I have it in me to code it by hand...

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-08-10 14:58
 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Wed, 2011-08-10 17:08

Can you tell me how you did that? I'd like it to be a little different from that and invoke my style sheet and so on... but I'm liking the idea! However, it doesn't give me a unique url for each page...

Also how easy is it to create my own frames in G3 like I have in G2? Will they import over?

>^,,^<
http://opalcat.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Wed, 2011-08-10 17:09

(Also even if I don't upgrade to G3, I'd like to change some parts of my G2 theme but I don't remember how I got it. I know it was some website that did it for me...)

>^,,^<
http://opalcat.com

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-08-10 17:33
opalcat wrote:
Can you tell me how you did that?

Its a bit of forced trickery.
Using jQuery/Ajax I pass a url to a proxy script which fetches the content of the url, replaces undesirable elements and returns the resulting html.

Then I have jQuery populate a specific DOM element w/ the desired contents of one of the returned html's own DOM elements.

    $('#gallery_content').empty().load('proxy.php?earl=/index.php' + ' #g-content', function(){
        // do some style adjustment and stuff
    });

Chris Coyier over at css-tricks has a great tutorial http://css-tricks.com/6336-dynamic-page-replacing-content/
And you can even use hash tags for history/unique urls

my simple embed tool helped you in the past.
http://www.flashyourweb.com/gallery2/embed_samples/

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-08-10 18:19

jQuery/javascript to add your image frames back in G3:

function framify(el){
    var theImg = $(el).find('img');
    var theW = theImg.attr('width') - 71;
    var theH = theImg.attr('height') - 26;
    var theHtml = $(el).html();
    $(el).html('<table cellspacing="0" cellpadding="0" border="0" class="ImageFrame_OpalCatBlue"><tbody><tr><td class="TL"></td><td class="TTL"></td><td style="width:'+theW+'px"class="TT"><div class="H"></div></td><td class="TTR"></td><td class="TR"></td></tr><tr><td class="LLT"></td><td class="IMG"colspan="3"rowspan="3">'+theHtml+'</td><td class="RRT"></td></tr><tr><td style="height:'+theH+'px"class="LL"><div class="V">&nbsp;</div></td><td style="height:'+theH+'px"class="RR"><div class="V">&nbsp;</div></td></tr><tr><td class="LLB"></td><td class="RRB"></td></tr><tr><td class="BL"></td><td class="BBL"></td><td style="width:'+theW+'px"class="BB"><div class="H"></div></td><td class="BBR"></td><td class="BR"></td></tr></tbody></table>');
}

http://suprsidr.com/opalCat.php

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Thu, 2011-08-11 02:09

I finally figured out how I did it last time! I didn't use the website after all. I edited themes/matrix/templates/theme.tpl

Is there a similar file in G3 that I can edit and use to make G3 match my site?

>^,,^<
http://opalcat.com

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-08-11 02:16

gallery3/themes/your theme/views/page.html.php

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2