Help changing rendering order of a couple of Divs

Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Fri, 2012-05-11 23:54

Hi, I'm new here and would like some help. I have some experience with MVC apps and CSS, so I am not a novice. I have taken a copy of Clean_Canvas theme and I am currently customising it to resemble a wordpress theme I use for the rest of my site.

Wordpress: http://boroniaparkframing.com.au/
Gallery3: http://boroniaparkframing.com.au/shop/

I have successfully made progress with the layouts in the theme CSS. Now I need to (I assume) move into the Gallery php and make some changes. I have some questions and need some help.

1. I want to move the Div g-info to render inside the Div g-album-grid (so it looks like the wordpress site). I can't find where these Divs exist in the php. I have downloaded a copy of the entire gallery3 folder to my PC, and searched for the text using windows search, but still couldn't find it. Can someone help me find where these divs exist?
2. I want to modify the g-site-menu Div so it renders 100% of the width of the site, but once again can't find it.
3. Is there a way I can change the php while still keeping the changes in the theme? ie can I take a copy of the php files and put htem in the theme folders hence making Gallery3 upgradable without recoding?
4. I made a copy of the clean_canvas, changed the theme.info and loaded it on my site in a new folder, but it doesn't appear in the themes list in my site. Am I missing a step?

That is enough to get me started. If someone can help with these things, I could probably finish it off.

Thanks in anticipation.

Matt

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2012-05-12 01:54

There is another way, using jQuery to embed G3 http://www.flashyourweb.com/gallery2/embed_samples/g3_ajaxGallery.php

-s

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Sat, 2012-05-12 02:44

Yes, that is very nice, but I am trying to set up an online shop.

Can anyone help me with my questions?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-05-13 01:32

@g-info, I don't see that in the source of my test install so I would suspect it comes from your theme.
yes, album.html.php

<div id="g-info">
  <?= $theme->album_top() ?>
  <h1><?= html::purify($item->title) ?></h1>
  <div class="g-description"><?= nl2br(html::purify($item->description)) ?></div>
</div>

You could move it to page.html.php and wrap it in a if album check.

@g-site-menu,
css:

#g-site-menu {
    bottom: 0;
    left: 160;
    position: absolute;
}

make the 160 0
add a width attribute if desired.

@changes in php for your theme, create a copy of your theme and use it. If you are changing other php files you have to create a MY_xxxx.php of the file. See the grey dragon theme for examples of how it overrides other core code.

4: should work: http://codex.gallery2.org/Gallery3:Themes#Duplicate_and_deploy_your_copy_of_the_default_theme

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Wed, 2012-05-16 22:27

Floridave

I have made some progress- thanks

I am now trying to render an image before and after the nav bar. I have added this code immediately after the #g-site-menu css. Trouble is it is not rendering. I have no idea why - this is the same code used in wordpress.

#g-site-menu:before{
	position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background: url("http:/boroniaparkframing.com.au/images/nav-left.png") no-repeat;
	/* left: -50px;
	top: 0px; */

}

#g-site-menu:after {
	position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background: url("http:/boroniaparkframing.com.au/images/nav-right.png") no-repeat;
	left: 0px;
	top: 0px;

}

The second issue I am having is that I can't find the CSS for the actual menu items. I am looking for g-menu-link and sf-with-ul and I can't find them in any of the gallery files. I don't actually understand WHY I can't find them, nor how to go about finding them. I have searched for the text using windows search, but for some reason that never seems to work. Any advice on how I can improve my efforts to find the CSS code I am looking for would be appreciated. I use Firefox inspector to find out the name of the css I need to find.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-05-17 02:28

I think the syntax for background images is
background-image: url("http:/boroniaparkframing.com.au/images/nav-left.png") no-repeat;

I have not played much with the :before and :after selectors so your not going to get much from me.
not sure how it works with un-ordered lists <ul>
The menu is a list.

#g-site-menu is in gallery3/themes/yourtheme/css/screen.css

/* Site Menu  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

#g-site-menu {
  bottom: 0;
  left: 140px;
  position: absolute;
}

#g-site-menu ul {
  margin-bottom: 0 !important;
}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Thu, 2012-05-17 02:59

OK, thanks. I have tried all the conceivable permutations but can't get anything to work (with before/after).

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Thu, 2012-05-24 19:47
Mallycat wrote:
I am now trying to render an image before and after the nav bar.

Wouldn't it be easier to just add the image to page.html.php?
If, for some reason, you MUST do it with css, combine both images as one (with transparent space between, for the nav menu), enlarge the height of the nav to accommodate the images, then add the appropriate padding to the top/bottom.

There are better ways, but all of the css plays together. This also avoids me having to look at the whole before/after thing; not sure what browsers that works in.

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Fri, 2012-05-25 00:36

Thanks. That's a good idea. The before and after is the way it is done in wordpress, and that allows for modifications to the width of the site. But given my width is already decided, I can take the approach you suggest.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-05-25 03:33

to render absolute positions within an element and not globally the parent div needs to have its position defined ie.

<style>
  nav { position:relative; }
  nav > ul:before { 
        position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background: url("http:/boroniaparkframing.com.au/images/nav-left.png") no-repeat;
	left: -50px;
	top: 0px;
   }
   nav > ul:after {
	position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background: url("http:/boroniaparkframing.com.au/images/nav-right.png") no-repeat;
	left: 0px;
	top: 0px;
  }
</style>
<nav>
  <ul>
    <li><a href="/">Home</a></li>
    <li>....
  </ul>
</nav>

http://css-tricks.com/absolute-positioning-inside-relative-positioning/

-s

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Fri, 2012-05-25 06:40

Thanks for your help. I have tried this and it didn't work. But I am now thinking that maybe there is something different wrong. This is what I have.

#g-site-menu {
	bottom: 0;
	left: 0;
        height: 45px;
        width: 960px;
	background: url('http://boroniaparkframing.com.au/events/themes/clean_canvas/images/nav-bg.png') #8F4DB3 ;
        position: relative;
}

For some reason this background image is not rendering at all. I have tried everything I can think of, including the full path of the image. If I change the colour, it updates just fine. I have tried background-image: as an alternative, but that doesn't help. So why wouldn't this image be rendering if the colour is working?

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2012-05-25 18:44

I didn't look long enough to figure out why, but the background is set to:
url("http://boroniaparkframing.com.au/events/themes/clean_canvas/css/http://boroniaparkframing.com.au/events/themes/clean_canvas/images/nav-bg.png") repeat scroll 0% 0% rgb(143, 77, 179)

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Sat, 2012-05-26 00:07

So how did you find what the background was set to? I have changed it, I hope it is right now, but it still doesn't render.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-05-26 15:19

It's now set to:
url("http://boroniaparkframing.com.au/shop/themes/clean_canvas/css//images/nav-bg.png") repeat scroll 0% 0% rgb(143, 77, 179)
That URL gives a 404 (with and without the double slashes).

You can use any number of tools to check style definitions. I've never used firebug (for firefox), but that's the one I hear the most about and new users seem to figure it out quickly.

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Sun, 2012-05-27 22:10

Hey, thanks a lot for the tip. Firebug looks really good and helped me solve this problem (first step anyway). I have got the bg image happening, can now see that the before and after css code is not rendering into the live CSS. I will take a look at that when I have more time. If anyone has any ideas why that code doesn't come through, I would be please to hear from you. Could it be a CSS version issue?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-05-28 03:37

Could be a doctype issue
WP has <!DOCTYPE html>
G3 has:

<!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"  xml:lang="en" lang="en">

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Mallycat

Joined: 2012-05-11
Posts: 14
Posted: Sat, 2012-06-02 04:07

I have got the background image fixed thanks to the tips and firebug. What is now interesting (using Firebug) is that not all the CSS is showing in Firebug

so I have this

#g-site-menu {
	bottom: 0;
	left: 0;
        height: 45px;
        width: 960px;
	background: url('../images/nav-bg.png') #8F4DB3;
        position: relative;
}

#g-site-menu:before {
	position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background-image: url('../images/nav-left.png') no-repeat;
	left: 0px;
	top: 0px;

}

#g-site-menu:after {
	position: absolute;
	content: " ";
	width: 50px;
	height: 50px;
	display: block;
	background-image: url('../images/nav-right.png') no-repeat;
	left: 0px;
	top: 0px;

}

but this is what firebug shows

#g-site-menu {
    background: url("http://boroniaparkframing.com.au/events/themes/clean_canvas/css/../images/nav-bg.png") repeat scroll 0 0 #8F4DB3;
    bottom: 0;
    height: 45px;
    left: 0;
    position: relative;
    width: 960px;
}
#g-site-menu:after {
    content: " ";
    display: block;
    height: 50px;
    left: 0;
    position: absolute;
    top: 0;
    width: 50px;
}

So any ideas why:
1) the #g-site-menu:before is missing
2) the image reference in the "after" is missing