Floatrix theme issues/tweaks

evildmp

Joined: 2008-10-12
Posts: 4
Posted: Sun, 2008-10-12 15:52

I notice that the Floatrix theme 1.0.6 seems to have a few issues.

  • the doctype requires a xmlns="http://www.w3.org/1999/xhtml" on the root element, as in in: <html xmlns="http://www.w3.org/1999/xhtml">
  • the code for the sidebar incorrectly puts block-level elements (<div>s) inside an inline element (the <a>). This is easy enough to work around, by making those <div>s into <span>s, and giving them a display: block in CSS
  • there's quite a bit of invalid code in the CSS

I'd like to amend theme.tpl so that the sidebar is only available to logged-in users - how could I do this?

Finally, I haven't worked out how to put PHP into a .tpl file - is this possible?

Thanks,

Daniele

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2008-10-12 16:16
Quote:
# the doctype requires a xmlns="http://www.w3.org/1999/xhtml" on the root element, as in in: <html xmlns="http://www.w3.org/1999/xhtml">

That's fixed in the next version 1.0.7 that will be released with G2 2.3 next week.

For the other 2 points, please feel free to fix them and post your fixes here. I would install 2.3 next week and work of off 1.0.7 though since there are a few minor changes.

For the sidebar, add the bolded part

{if $user.isRegisteredUser}
      {if !empty($theme.params.sidebarBlocks) && $theme.pageType != 'admin'}
      <a href="{g->url params=$theme.pageUrl arg1="jsWarning=true"}" id="showSidebarTab"
          onclick="MM_changeProp('gsSidebarCol','','style.display','block','DIV');
              MM_changeProp('showSidebarTab','','style.display','none','DIV');
              return false;">
          <div style="width:20px; height:50px;"/></div></a>
      <div id="gsSidebarCol" class="dropshadow">
        {g->theme include="sidebar.tpl"}
      </div>
      {/if}
{/if}

To add php code to smarty templates you can use the PHP tags

{php}
your php code here
{/php}

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
evildmp

Joined: 2008-10-12
Posts: 4
Posted: Sun, 2008-10-12 17:11

Thanks for such a quick reply. I'll post any fixes here once I'm satisfied they work as expected.

Daniele

 
evildmp

Joined: 2008-10-12
Posts: 4
Posted: Sun, 2008-10-12 20:38

Here's another query about this theme.

Is it possible to have the description:

Quote:
<p class="giDescription">{$child.description|markup|entitytruncate:256}</p>

appear when the child is an album, but not when it's a photo?

Or similarly, independently control summaries for child albums and photos?

Thanks,

Daniele

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2008-10-13 02:13

Yes, take a look at album.tpl and find a line of code in there that says

{if $child.canContainChildren}

for an example of how to decide if an item is an album.

Here's an example of how the class names are chosen for the thumbnails:
<div class="{if $child.canContainChildren}giAlbumCell gcBackground1{else}giItemCell{/if}"
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
evildmp

Joined: 2008-10-12
Posts: 4
Posted: Mon, 2008-10-13 16:12
nivekiam wrote:
Yes, take a look at album.tpl and find a line of code in there that says

{if $child.canContainChildren}

for an example of how to decide if an item is an album.

Thank you once again - I hope you aren't getting sick of these...

Next question:

Quote:
{g->block type="core.Navigator" navigator=$theme.navigator reverseOrder=true}

Is there some way I can make this generate only a previous and next, and not a first and last?

Daniele

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2008-10-13 16:46

It's much easier when you can point someone in a direction instead of having to spell everything out for them ;) Do no I don't mind you asking at all ;)

For the first/previous, there are a couple of ways you can go about that. If you look at the source of the page you'll actually see that is wrapped in a div with the class name first-and-previous so you can just choose to hide that with css or you can do some hacking on /modules/core/templates/blocks/Navigator.tpl

If you are using version 2.3 or when you upgrade to 2.3 you can actually store your modified core template changes like those to Navigator.tpl with your custom theme so everything can be wrapped in a nice little package instead of having to modify files all over G2.

See "Use a theme override" on this page: http://codex.gallery2.org/Gallery2:Editing_Templates

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here