linkitem module - customizing template - getting variables from buffered debug?

greendress

Joined: 2005-11-19
Posts: 3
Posted: Sun, 2005-11-20 02:48

Here's my story: I have the linkitem module installed. What I'm after is to modify the album display so that albums I have linked are titled "Related Album: XXX".

[ I am aware that I could manually edit every album link so the title actually is "Related Album: XXX", but the goal here is to NOT have to do anything one by one. I would actually greatly prefer if I could just modify the code so that when I create the link, it automatically populates the g_title field of the g2_Item table with "Related Album: XXX" right from the get-go, but I couldn't even find myself a starting point for trying that. Still, if anyone wants to tell me some way I can do that, you can just stop reading now and go right ahead! ;-) ]

Anyhow, I've gathered that a good starting point might be my local (I've already got it in its own 'local' directory) album.tpl for my theme - specifically, I'm looking this section:

Quote:
{if !empty($child.title)}
<p class="giTitle">
{if $child.canContainChildren}
{g->text text="Album: %s" arg1=$child.title|markup}
{else}
{$child.title|markup}
{/if}
</p>
{/if}

What I'm thinking is that I could get something along the lines of (with the text in blue to be replaced with something real):

{if $child.canContainChildren}
{g->text text="Album: %s" arg1=$child.title|markup}
{elseif [g2_Entity.g_entityType=GalleryLinkItem]}
{g->text text="Related Album: %s" arg1=$child.title|markup}
{else}
{$child.title|markup}

So, I thought a good starting point would be to put gallery in buffered debug mode and see what kind of variables are available. http://codex.gallery2.org/index.php/Gallery2:Tpl_Reference says To see all variables available for a page: turn on buffered debug output in config.php and reload the page. A popup window will show available data; to reference a variable connect levels of indentation with ".", as shown above to connect "user" with "userName".

So, I've turned it on. First off, I don't get a popup window (in either Firefox or Explorer), but the debug text appears on the same page, below the actual gallery display (took me a minute to realize what was going on, since I was waiting for a popup). But whatever, the real problem is that I just am not seeing the variables. Exactly what am I looking for? I'm attaching the text that I get on the album page in question. Could some kind soul point out the variables to me, if they're there? Or if they're not there... where are they?

Thanks for any help anyone can provide!


Gallery version = 2.0.1+ core 1.0.9
PHP version = 4.3.10 apache
Webserver = Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database = mysql 4.1.14-Debian_3-log
Toolkits = Gd
Operating system = Linux sepulveda 2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

AttachmentSize
debugoutput.txt77.2 KB
Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 10640
Posted: Sun, 2005-11-20 11:17
Quote:
So, I've turned it on. First off, I don't get a popup window (in either Firefox or Explorer)

Yeah, I just discovered that tonight. You're running either a nightly build or CVS version. A change made to main.php did this. It's probably a bug, I'm calling it a bug :) Here's where the change that made the Smarty Debug popup go bye-bye happened: http://cvs.sourceforge.net/viewcvs.py/gallery/gallery2/main.php?r1=1.137&r2=1.138

I submitted a bug report here: http://sourceforge.net/tracker/index.php?func=detail&aid=1362038&group_id=7130&atid=107130
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments