WPG2 Album Tree loading in a w/p page ?

kabouum

Joined: 2008-10-23
Posts: 8
Posted: Thu, 2008-10-23 21:01

How to have the widget (WPG2 Album Tree) to load on a wp page instead of the side bar ? My problem is my album is to big and to large to fit on the side bar. I made it work by creating a wp page call Family album tree and copy and paste the html source from the side bar widget. Then I remove the widget and it work but now if I add a new album in gallery2 the page does not get automatically updated like the side bar did. You can see my site at http://marilyn.clubplus.net
There must be a better way... Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-10-24 00:51

So you want to add:
http://4megs.com/gallery2/main.php?g2_view=albumselect.Navigation
to a word press page?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-10-24 00:58

--See attachment.
--Download that file.
--Extract the files from that file.
--Upload the files from that extraction to the correct location on the server. It will be self explanatory/intuitive as to were they should go.
--visit:
http://EXAMPLE.com/gallery2/main.php?g2_view=albumselect.Navigation
to verify the operation of the new operation of the module.

Then you should be able to add it via some php on your page.
like:

<?php
@readfile('http://YOURSITE.com/gallery2/main.php?g2_view=albumselect.Navigation');
?>

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Fri, 2008-10-24 13:21

Thanks
I am almost there, if I go to http://marilyn.clubplus.net/gallery2/main.php?g2_view=albumselect.Navigation It work fine but the

Quote:
<?php
@readfile('http://marilyn.clubplus.net/gallery2/main.php?g2_view=albumselect.Navigation');
?>

is not working, you just see php tag.
Maybe the wp page is not a php page?
How I get the http://marilyn.clubplus.net/gallery2/main.php?g2_view=albumselect.Navigation to load in that wp page at http://marilyn.clubplus.net
Thanks again

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Fri, 2008-10-24 14:13

I did a <iframe name="cwindow" width=610 height=2400 src="http://marilyn.clubplus.net/gallery2/main.php?g2_view=albumselect.Navigation"></iframe>

So now the tree load in a window in the wp page but the height is not automatic like before.
Also how do I change the size and color of the text in the tree.
Thanks again

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Fri, 2008-10-24 14:46

Oups, no good that window, the links on the album tree are opening gallery2 in the window that in the wp page, (to small). It should open like before, the w/p header on top, no side bar and Gallery2 bellow. Maybe change the links?
Or maybe go back to try to load the php in the page?
Thanks again

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-10-24 17:27

I guess there is a few ways to do this:
1. Add <base target="_top"> to your html. I guess that would go in the WP theme header.

2. change the bold in the template file to add a target:
{$albumTree}.add({$node.nodeId}, {$node.parentNode}, "{$title}", "{g->url arg1="view=core.ShowItem" arg2="itemId=$itemid" arg3="target=parent" forceFullUrl=1}");

3. Edit the JS that builds the tree, add the bold:

      {$albumTree}.config.useLines = {if $params.treeLines}true{else}false{/if};
      {$albumTree}.config.useIcons = {if $params.treeIcons}true{else}false{/if};
      {$albumTree}.config.target = 'parent';

4. Install a WP plugin that allows you to add php to your pages/posts.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Fri, 2008-10-24 18:01

Thanks ... I let you know

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Sat, 2008-10-25 00:12

Getting there, but the Expand all | Collapse all links are showing onclick="this.blur()">Expand | onclick="this.blur()">Collapse but they work and the links on the album are taking you out of the w/p
Also I am not sure were to put the

Quote:
<base target="_top">

You can see my test page at http://marilyn.clubplus.net/?page_id=535
Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2008-10-25 00:39

How are you adding this to the page? I suspect your WP adds some <br /> tags to the code you pasted.

using <base target="_top">
would be used if you are using a <Iframe> like you suggested you wanted to do.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kabouum

Joined: 2008-10-23
Posts: 8
Posted: Sat, 2008-10-25 01:52

I install the plugin exec-php to w/p and I added the first php code <?php
@readfile('http://YOURSITE.com/gallery2/main.php?g2_view=albumselect.Navigation');
?> to a test page. See results at http://marilyn.clubplus.net/?page_id=535

For the second option I put the <base target="_top"> before the <Iframe> in the wp page. and still opening the Gallery2 in the page.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2008-10-27 04:05

Your wordpress plugin does not like breaks for some reason in the JavaScript.
your page:
http://marilyn.clubplus.net/gallery2/main.php?g2_view=albumselect.Navigation
has this:

<p>
<a href="javascript: albumTree.openAll()"
onclick="this.blur()">Expand</a>
|
<a href="javascript: albumTree.closeAll()"
onclick="this.blur()">Collapse</a>
</p>

but with your WP plugin it delivers

<p>
<a href="javascript: albumTree.openAll()"<br />
onclick="this.blur()">Expand</a><br />
|<br />
<a href="javascript: albumTree.closeAll()"<br />

onclick="this.blur()">Collapse</a>
</p>

I would try to remove the wrapping from the Navigation.tpl and see if that helps.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team