G2 Theme API complete!

bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2003-09-11 23:54

Hi, all. It's taken me several weeks of steadily hacking on things, but I believe that I have come up with a pretty powerful theme API that passes a lot of control down into the theme without giving up control in the templates.

I have to write a lot of documentation about this and that'll take a little while. In fact, if there are any volunteers out there who'd be willing to work with me on documenting it that would be terrific. But in the meantime, let me give you a very basic thumbnail sketch of what's going on.

G2 template files don't contain HTML. Instead they contain a special set of tags that I designed. These tags are used to describe the page, so for example on a Site Admin page you have tags that say something like "put a side bar here. Put some side bar boxes inside them. This side bar box has a title, and here are a set of links to put into the box", except it's not in english so it'd look something like this (taken from modules/core/templates/SiteAdmin.tpl)

  {g->main} 
    {g->breadcrumb} 
      {g->item} 
        {g->title} 
          {g->text text="Site Administration"} 
        {/g->title} 
      {/g->item} 
    {/g->breadcrumb} 
 
    {g->sidebar} 
      {g->box style="sidebar"} 
        {g->title} 
          {g->text text="Admin Options"} 
        {/g->title} 
 
        {g->listing} 
          {g->item} 
            {g->title} 
               ...
            {/g->title} 
          {/g->item} 
          {g->item} 
            {g->title} 
               ...
            {/g->title} 
          {/g->item} 
        {/g->listing} 
      {/g->box}   

      ...

I cut out some of the logic because it doesn't serve this illustration. So now we have a template file that describes the page. For each of these elements, G2 will then pass control to the theme. So the theme will get a call saying "Create a listing with these items", then "create a box of style sidebar with this title, and put that listing in it", then "create a sidebar and put these boxes in it". G2 groups the contents of any themed element and passes them to the theme in the form of a function call. The theme then spits out HTML to render the item.

Look in themes/matrix/theme.inc for an example theme. Yes, this is a little complex at first, and we will have to write a theme developer's guide to explain it all. But in the meantime, check out how every single bit of HTML gets generated in this one theme file. The theme decides whether the entire application uses <tables> or <divs> (well ok, there is a "table" themeable element -- but you could implement that using divs if you wanted). If you want XHTML or HTML4.01 compliance, you do it here. All style sheet specifications happen here.

If you want to get started quickly, try this. In the themes directory, copy the "matrix" directory to something new, like "foo". Then edit themes/foo/theme.inc and change any references to MatrixTheme to FooTheme (the class name must line up with the directory name). Then go and tinker with the styles/theme.css file and make some changes. Then edit the Album Settings of any album and change its theme to your new foo theme. Voila! You have created a new theme -- now you can screw around with the PHP and the CSS to get it to do exactly what you want!

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Fri, 2003-09-12 02:40

And just in time for my first day of Vacation. =)

I'll have the entire day tomorrow to look at the coding.

Way to go!!

=)
Jade

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2003-09-18 22:24
JadeDragon wrote:
And just in time for my first day of Vacation. =)

I'll have the entire day tomorrow to look at the coding.

How's it going? Any questions?

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Wed, 2003-09-24 01:40

Unfortunately this Vacation was cut short. So I haven't had a chance to look at it yet.

I'll see if I can pop it up online tonight and have a go at it tomorrow evening.

Sorry Bharat! just to many things going on in RL at the moment.

=)
Jade

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Wed, 2003-09-24 02:44

Online it is. Installation went fairly well...once I read all the instructions.

I will take a look at the templates tomorrow night if I get off of work at a decent hour. I will keep you updated!

=)
Jade

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Sat, 2003-09-27 22:24

Work in progress.

http://drazanfamily.com/g2/gallery2/main.php?g2_view=core:ShowItem&g2_itemId=5

If it is broken, try back later. I will be working on the different Theme/ Layouts so you may even see the Matrix come back as I work out the coding.

=)
Jade

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Sun, 2003-09-28 01:44

Update: the theme.inc

I looked through all the code and made my notes accordingly. Alot of them are for my own use at the moment, so they may not make sense to you. I will clean them up once I create a new theme.

My notes are viewable here.
http://drazanfamily.com/g2/gallery2/notes/theme.inc.txt

again these are preliminary notes.

=)
Jade

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Sun, 2003-09-28 01:59

And just because I'm not a php Guru....

bharat (& team), did I identify the functions correctly? And is there anything you want to add to my notes? I'm sure I missed a couple things this time around.

Another note: can we add a two pieces of code to the global.tpl? I would like to add the {wrap_header} & {wrap_footer} from Pixel Poets tutorial. Perhaps name them {overall_header} & {overall_footer}. Even if the included header/footer pages are blank, the possibilities for integration into current sites is excellent. Otherwise I didn't see an easy way of doing this.

I did a mod like this for phpbb, but they use a different templating system. I didn't see where I could add something to test it out. Pointers?

I hope this brings us forward a step to get some themes/layouts done.

=)
Jade

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2003-09-30 09:12
JadeDragon wrote:
And just because I'm not a php Guru....

bharat (& team), did I identify the functions correctly? And is there anything you want to add to my notes? I'm sure I missed a couple things this time around.

Sorry for the delay -- I've been swamped the past two days. Getting you going is a big priority for me and I promise to be more responsive!

I looked at your comments a couple of days ago and they looked pretty accurate, except for one thing, but I can't remember which thing that was right now and your site is down! (or at least I can't reach it at the moment). :-( I'll try again ASAP.

In the meantime, I have a plan to create what I call a "template sampler" . This is a new module that will have a series of pages, each which contains a whole lot of different types of themeable objects all on one page. The plan is that you can modify your theme then go to this sampler page and see lots of different variations at a glance to know how your change is going to look. Will this be helpful to you? Any feedback on this would be very helpful

JadeDragon wrote:
Another note: can we add a two pieces of code to the global.tpl? I would like to add the {wrap_header} & {wrap_footer} from Pixel Poets tutorial. Perhaps name them {overall_header} & {overall_footer}. Even if the included header/footer pages are blank, the possibilities for integration into current sites is excellent. Otherwise I didn't see an easy way of doing this.

I did a mod like this for phpbb, but they use a different templating system. I didn't see where I could add something to test it out. Pointers?

I keep going back and forth about having a global header and footer. Ie, I keep adding them and taking them back out and then adding them again. Right now they're out. Here's why.

G1 can be run in standalone and embedded modes at the same time. But this causes more problems than its worth, so my plan for G2 is that you pick which mode you want to run it in and leave it at that. This means that if you're embedding it into your website you're going to have it embedded all the time. So my plan is that you get to modify global.tpl to make it look exactly the way you want to fit into your site.

In the old system, you had to modify header and footer files separately and it was hard to see your changes in context. But with this system, you have just one file and as long as you leave the two {include} tags in there, you can decorate your G2 any way that you want. Typically I figure this means that you put your standard site header and footer on the page and maybe an overall stylesheet (or not). The theme controls everything thats rendered inside those {include} tags.

I have a plan for the future where you don't actually modify global.tpl, but you modify global.tpl.new (or something) so that when we upgrade your changes don't get overwritten. Haven't done that yet, though :-)

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Tue, 2003-09-30 10:46
bharat wrote:
I looked at your comments a couple of days ago and they looked pretty accurate, except for one thing, but I can't remember which thing that was right now and your site is down! (or at least I can't reach it at the moment). :-( I'll try again ASAP.

In the meantime, I have a plan to create what I call a "template sampler" . This is a new module that will have a series of pages, each which contains a whole lot of different types of themeable objects all on one page. The plan is that you can modify your theme then go to this sampler page and see lots of different variations at a glance to know how your change is going to look. Will this be helpful to you? Any feedback on this would be very helpful

<snip>

G1 can be run in standalone and embedded modes at the same time. But this causes more problems than its worth, so my plan for G2 is that you pick which mode you want to run it in and leave it at that. This means that if you're embedding it into your website you're going to have it embedded all the time. So my plan is that you get to modify global.tpl to make it look exactly the way you want to fit into your site.

In the old system, you had to modify header and footer files separately and it was hard to see your changes in context. But with this system, you have just one file and as long as you leave the two {include} tags in there, you can decorate your G2 any way that you want. Typically I figure this means that you put your standard site header and footer on the page and maybe an overall stylesheet (or not). The theme controls everything thats rendered inside those {include} tags.

I have a plan for the future where you don't actually modify global.tpl, but you modify global.tpl.new (or something) so that when we upgrade your changes don't get overwritten. Haven't done that yet, though :-)

Yes, my host is running a check on the file server, so a couple of my sites are down. Should be back up soon.
At this point I'm not sure if having the "template sampler" is needed. It may be beneficial to users who don't know a lot of coding and the preview feature would be nice, but at this stage, I won't need it. When you do have something done up, I'd be willing to test is out for you.

I'll take another run through the functions and see if I can spot my mistake. It was very late when I went through it the first time. :wink:

This is part of the code I couldn't figure out. What does it do?

/**
     * linkset theme method
     * 
     * @param array ("params" => ..., "stack" => ...)
     * @param array ("params" => array, "content" => title HTML content)
     * @param array ("params" => array, "content" => item HTML content)
     * @return string HTML content
     */
/* Jade = not sure what this function is for...
*/
    function linkset($context, $title, $item_array) {
	$buf = '<span class="linksbox"> ';
	if (!empty($title['content'])) {
	    $buf .= $title['content'];
	    $buf .= '&amp;';
	}
	for ($i = 0; $i < sizeof($item_array); $i++) {
	    if ($i > 0) {
		$buf .= ' | ';
	    }
	    $buf .= $item_array[$i]['content'];
	}
	$buf .= '</span>';
	return $buf;
    }

There's some other blocks which I didn't label, but are easy enough to identify.

If I don't work to late tonight, I'll see if I can squeeze in another test run and maybe start some graphics for a new theme.

Once I have the Theme going, I'll start looking into layouts.

I hope to have the first basic themes done by this weekend. (That's the plan anyway)

=)
Jade

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Tue, 2003-09-30 15:41

A "template sampler" or "dummy module" would be very useful as an example not only of templates but also our module format. I am +1 for this.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2003-10-02 07:14

Jade --

Ok! I got some free time to go through your stuff and your site is back up again so let me reply to your comments.

/* Jade = not sure what this function is for...
*/
    function linkset($context, $title, $item_array) {

A linkset is really just a set of links. Right now we use them to display the page navigator on the album body, at the bottom of the page. Upload a whole bunch of items into an album (using the "upload from local server" is fast and easy) and you'll see at the bottom of the album page, a set of links like this: "Page # | # | .. | #". That's a linkset.

We also use linkset to display the "edit" and "delete" links that are visible on comments. Add a comment to an album or item, then view the album/item as a site admin and you'll see those links appear.

/* Jade = Column header appears over the main album image and above each picture in "view album"
*  Not useful for a design element.
*/
    function row($context, $column_array) {

I'm not exactly sure what you mean by this comment. Just to be clear, the {g->row} function is really a direct analog of the <tr> table element. It will contain {g->column} elements, and those can be marked as header columns by saying: {g->column header="true"}. So a table that has a header row, then some regular rows would look like this:

{g->table}
  {g->row}
     {g->column header="true"} .. {/g->column}
     {g->column header="true"} .. {/g->column}
     {g->column header="true"} .. {/g->column}
  {/g->row}
  {g->row}
     {g->column} .. {/g->column}
     {g->column} .. {/g->column}
     {g->column} .. {/g->column}
  {/g->row}
   ...
{g->table}

In the main() function, you note:

Quote:
/* Jade = The Left Side bar that you see in the Admin panel & the Right Side Bar that you can see in the Gallery page.
* Customization is possible. Do not know if the Gallery link panel can be switched to left.
* Also a possibility to add small banners or personal site menus. Valued for content areas.
*/

Yes, you can definitely move the side bars around if you want. It's up to the theme to put them wherever you want. The sidebar does give you a hint with the side attribute (eg, {g->sidebar side="right"}) but you can ignore that if you choose :-P

And then for action item, you say:

Quote:
/* Jade = This should really be viewable by admin only. Can we create the if/else statment for this function?
*/
function actionitem($context, $title, $value) {

Actionitem will also be viewable by regular users. For example, the "add comment" link will appear here if you have permissions to add a comment to the given item. Edit an item's permissions and grant the "add comment" permission to All Users, then go back to the album (or item) view and you'll see it appear. This will be the main way for us to allow users to interact with an individual item. I made it themable so that you can replace the <select> dropdown with a funky <DIV> menu that or something if you choose :-)

The rest of your comments look pretty accurate. Let me know if you have any other questions -- I am looking forward to seeing what you come up with!

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Wed, 2003-10-15 11:16

Sorry this has taken so long. I had a deadline for a story to be published this year. Now that is done I can turn my attention to Gallery again. Should have something to show you this weekend.

=)
Jade

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2003-10-16 08:07

No worries, Jade. We've got a new theme for you to look at, called "veloria". It's under development by jackodog (the original G1 ui designer). Take a peek at that for other ideas! I understand that he's doing a much better job on the CSS than I did in the matrix them :-)

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Thu, 2004-01-01 15:18

I'm back working on this. RL has proceded to limit my net activities for the past couple months. Things have settled down and I have more free time. Yay!

I'll be posting soon!
=)
Jade

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2004-01-02 22:44

Hey Jade! Good to have you back. FYI, the current theme API appears to be too daunting to most graphic designers so while it is very powerful we're going to back down to a strategy that uses pure CSS-ready HTML in the template files and the themes will become just CSS and its support files (like images). This will make life a lot easier for graphics designers though it will make some things impossible. So don't spend too much time on the current model just yet .. give us a couple of weeks to rework it.

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Sat, 2004-01-03 17:38

Just let me know what you need me to do. I'll check back in often.

=)
Jade

 
mattdpeterson

Joined: 2003-12-10
Posts: 4
Posted: Sat, 2004-01-03 20:54

Does this mean that you're ditching layouts? I really need to be able to customize the layout for a client I'm working on and G2 is the only way i've seen right now that looks anything like what I need.

I've been working through the current layout to try to figure out exactly how to customize it and while it doesn't seem that hard, a glossary of what the different tags do would go a LONG way towards determining how to get the layout to work.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2004-01-04 08:09

Don't worry, we're not ditching layouts. All we're going to do is to change the contents of the .tpl files so that instead of using tags like {g->box} and letting the theme rewrite that as a <div> (or a <table>) we're going to use <div>s in the .tpl file directly. This will allow the theme to be just a CSS file which'll make life a lot easier for theme developers.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2004-01-04 23:24

Which {g-> tags are going away? Just table related ones or all of them?

 
mattdpeterson

Joined: 2003-12-10
Posts: 4
Posted: Mon, 2004-01-05 06:39

Also.. as I'm going through this trying to customize the layout I'm really at a loss following some of the logic in the inc files regarding which tpl file does what. The sidebars are pretty self explanitory. Am at a loss for the albumbody, itemnavigator, and singlebody.

Basically, I'm looking at how to get at the pieces for how the top level gallery, album/sub-album, and the actual picture display get called.

To give some background, what I'm trying to do is to have a 3 column layout for the client. They need to have a number of albums, with 3 pictures in each. The item view will be in the center column, with the left column being textual links to first item in each album using the name of the album, the right column will be small thumbnails for each album in a 3 column/12 row list with no text under each.

The item view will need to have textual links under each item with the text 1,2,3 for the photos in the album.

My gut tells me that I'll need 2 different tpl's for each sidebar based off the same logic as the album view. For the left sidebar I'll just have to strip out everything but the textual piece of it, and just make sure that the first item in the album is the same as the album. For the right sidebar I'll do the same, but it'll simply be the thumbnail view.

What I'm at a loss for is, where the code is that determines the current album view (so I can take it out and play with it for the sidebars) and also where the code is the for the gallery view.

any help identifying where these pieces are, and if I'm looking at this the right way is correct, would be greatly appreciated.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2004-01-05 07:08

mindless, all the structural tags will go away, but the content tags (g->url, g->date, g->text) will remain. So for example, a snippet that looks like this:

  {g->box style="admin"} 
    {g->description} 
      {g->text text="Some text"} 
    {/g->description}                     
  {/g->box} 

will become something similar to this:

  <div class="AdminBox">
     <div class="Description">
      {g->text text="Some text"}
     </div>
  </div>        

So that it can be controlled directly by the CSS. That's pretty much the same transformation that the theme PHP code was doing anyway, but we'll get rid of the extra level of abstraction.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2004-01-05 07:23

Let me preface all of this by saying that I am still dissatisfied with the way that the layout code is structured. Right now, the layout has a lot of control over what's displayed and where it's displayed, but this means that the layout has to do a lot of work just to do a relatively simple render.

I've been toying with the notion of simplifying layouts considerably so that we generate the sidebars and navigation for you, leaving you with just the center area as your canvas. This would lift a lot of the work off of the individual layouts, but it would also limit what a layout could do. Any thoughts on that?

mattdpeterson wrote:
Also.. as I'm going through this trying to customize the layout I'm really at a loss following some of the logic in the inc files regarding which tpl file does what. The sidebars are pretty self explanitory. Am at a loss for the albumbody, itemnavigator, and singlebody.

Basically, I'm looking at how to get at the pieces for how the top level gallery, album/sub-album, and the actual picture display get called.

albumBody and singleBody are the two main styles of view (eg, are you looking at the contents of an album or are you looking at a single item?).
The itemNavigator is just a convenient snippet to put up the first/back/next/last links.

If you want to change how an album is rendered, you need to look in the _loadAlbumTemplate function in matrix/layout.inc and then the matrix/templates/albumBody.tpl file. There's a lot of stuff going on in there and I'm trying to figure out how to simplify it (see my statements above).

mattdpeterson wrote:
To give some background, what I'm trying to do is to have a 3 column layout for the client. They need to have a number of albums, with 3 pictures in each. The item view will be in the center column, with the left column being textual links to first item in each album using the name of the album, the right column will be small thumbnails for each album in a 3 column/12 row list with no text under each.

I think I understand. A simple sketch would help me visualize it, though. It sounds like you want to show thumbnails from multiple albums on the same page which is not a big deal, but it's different enough that you may
have a hard time re-using the stuff in the current matrix layout.

Since you want the center view to display an actual item, you should probably start by reusing bits from singleBody and just displaying a single item in the middle area. Then you can work with the sidebars to get the text contents that you want. This is certainly not going to be trivial (all of the layout work has been a real PITA thus far) and I want to make it easier but again I'm really not sure how to go about doing that.

 
mattdpeterson

Joined: 2003-12-10
Posts: 4
Posted: Mon, 2004-01-05 08:16

bharat.. you are the man.. thanks so much for all your work on this.

You can see an example of what I'm looking to do at
http://www.indiebandsites.com/test/gallery_mockup.jpg

I'll dig around in here and see what i can come up with.

 
mattdpeterson

Joined: 2003-12-10
Posts: 4
Posted: Mon, 2004-01-05 08:41

also, in relation to a way to approach making this easier for folks to customize. I've done alot of work with postnuke, and really like the way the guys over at Spidean put together AutoTheme. Basically boils down to:

Each page is made up of a series of html templates, main page template and box templates. each template requires that you put in a self descriptive tag (pre-defined as part of the theme engine) in each place that you want something to go. So for instance:

Lets say that in the above example of the 3 column layout, I'd create the main page with whatever header/footer html I wanted on every page. This main (lets call it "theme.html") would also include the table layout (or css divs), for the main page elements. It might looks like this
======================
<html>
<head>
</head>
<body>
<table>
<tr>
<td><!-- [leftblock] --></td>
<td><!-- [centerblock] ---></td>
<td><!-- [rightblock] --></td>
</tr>
</table>
</body>
</html>
==============================

Then each of the blocks would use it's own html file for the layouts. For example, lets use the example of the thumbnail list from the graphic in my previous post.
=========================
<table>
<tr>
<td>Albums</td>
</tr>
<tr>
<td><!-- [albumview1] --></td>
</tr>
</table>
===============================

Where albumview1 is configurable, as far as elements shown, positioning in either another .inc file, tpl file.. something. As one drills down through the page elements it's likely that the complexity will increase, which is to be expected.

Using these examples, it'd require that each of the differnt tags be defined, like in the current theme.inc file, it's just a little different. I suppose they could even just be stored in the database and there could be a GUI in the admin area to customize each of them.. or not, if they were all easily identifiable in the theme.inc it'd probably be just fine, just so long as there are user configurable ones.

I think the thing is to make it heirachical in such a way that as a designer drills down through the layers of customization it stay as simple as possible. In otherwords, in every file where it's possible to use a simple tag to call functionality defined elsewhere, rather than using code will ensure that as many people as possible can use the theme/layout system.

You might talk to Shawn McKenzie. He's the guy who developed autotheme for postnuke. His site is http://www.spidean.mckenzies.net (where you'll find a copy of gallery running :-). I think he goes by abracadaver elsewhere.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-01-06 03:40
Quote:
I've been toying with the notion of simplifying layouts considerably so that we generate the sidebars and navigation for you, leaving you with just the center area as your canvas. This would lift a lot of the work off of the individual layouts, but it would also limit what a layout could do. Any thoughts on that?

I prefer keeping the greater control. I'd like to be able to move things around or alter sidebar content in a layout. Just make it easy (and well documented) to do includes of the "standard" sidebar/navigation stuff in case you don't want to change them.

 
JadeDragon
JadeDragon's picture

Joined: 2003-02-15
Posts: 332
Posted: Thu, 2004-01-08 00:59

bharat

Do you want me to have a go with what you have done already? I'm on light workloads for the next couple months and could really put some time on this.

As far as layout structure, this needs to be on the user level. I thought that was one of the main goals of G2.

What's the latest working files? I'll take a look and offer my input.

=)
Jade

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2004-01-08 23:48
mattdpeterson wrote:
also, in relation to a way to approach making this easier for folks to customize. I've done alot of work with postnuke, and really like the way the guys over at Spidean put together AutoTheme. Basically boils down to:

Each page is made up of a series of html templates, main page template and box templates. each template requires that you put in a self descriptive tag (pre-defined as part of the theme engine) in each place that you want something to go. So for instance:

That's actually pretty close to what we're doing now, except that instead of having the top level page which decides whether to show the album view or the item view, we have it in two different files and just load the appropriate file. Stay tuned, though -- I want to go through and radically simplify how all of that works to make it more accessible to folks without them having to learn a lot of PHP & Smarty.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2004-01-08 23:50
JadeDragon wrote:
bharat

Do you want me to have a go with what you have done already? I'm on light workloads for the next couple months and could really put some time on this.

Certainly! You can get the latest G2 code from the snapshots (see the download link to the left) or from CVS and try it out. Most of what I said at the top of this post is still valid now so you can work with it and let us know what you think.

thanks!

 
vukicevic

Joined: 2004-02-02
Posts: 1
Posted: Mon, 2004-02-02 22:40

I've just updated my install of g2 from a few months ago, and figured I should probably write some feedback at least :)

Quote:
I've been toying with the notion of simplifying layouts considerably so that we generate the sidebars and navigation for you, leaving you with just the center area as your canvas. This would lift a lot of the work off of the individual layouts, but it would also limit what a layout could do. Any thoughts on that?

I would really urge you to keep the flexibility there (and the complexity along with it). It might limit people's ability to do their own custom themes, but it will allow others to come up with far more interesting things that those people can then use. For my g2 themes/templates, I wanted to remove the left and right sidebars, since I'm using gallery as more of a portfolio as opposed to a snapshot album. I added a new "bottom" sidebar position, and moved the sidebar contents (usually just "Login") down to the bottom of each page, in a muted dark gray on darker gray background color, leaving the rest of the page (width-wise) to be taken up by the presentation. I don't think I'd be able to do this or similar if I were only given the center canvas area to work with.

One question.. I wanted to replace items without titles with just "Image", but if they were in an album, I wanted to do "Image (from Albumname)". I can get the Image part fine, but I can't figure out how to get the parents' title.. {$item.parents[0].title} gives me the top-level title, which isn't quite what I want. I'm not sure if you parse array indices yourself or transform them into php -- any chance that negative indexes could be used as indices from the end of the array? i.e. {$item.parents[-1].title} would give me what I want. I can submit a patch for this if you like the idea as well.

Thanks for all the work on g2.. very happy with it, and I look foward to seeing where it goes in the future!