Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Browser Display

(Page 1 of 2)
> >
Quote Reply
Browser Display
I had an editor ask me:

Quote:


is there any way to show the full path on the
editor page that you see on the top of the page? i.e.:
BROWSE: Education (for example) It would be so much easier on those with
multiple categories to see the full path, like BROWSE: New
Brunswick/Education or whatever the case may be. That way you could make
sure you were in the right directory.


Does anyone know how I can solve this?

Thanks.
Quote Reply
Re: [sooke] Browser Display In reply to
This is the feature we named as title_linked in Links 2.0. It also exists in LSQL.

You can use one of these in globals if you want.

$tags{title_linked} = Links::Build::build ('title_linked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
$tags{title} = Links::Build::build ('title_unlinked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
return $tags;

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Browser Display In reply to
Webmaster! Thank you!

Do I just enclose these statements in sub { } and put them into my globals? Sorry for the obvious question.

I did this:

sub {
$tags{title_linked} = Links::Build::build ('title_linked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
$tags{title} = Links::Build::build ('title_unlinked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
return $tags;
}

and of course got an error when it tried to compile the global. I called it title_linked.

Do you mean use ONE of them literally?

Thanks

Last edited by:

sooke: May 12, 2002, 8:33 AM
Quote Reply
Re: [sooke] Browser Display In reply to
There are a couple of mistakes in the code. $tags is a hashref not a hash...webmaster33 treated it as a hash.

You need to change:

$tags{title_linked} and $tags{title} to $tags->{title_linked} and $tags->{title}

...and you need to add:

my $tags = shift;

Last edited by:

Paul: May 12, 2002, 8:35 AM
Quote Reply
Re: [Paul] Browser Display In reply to
Yep, you are right!

I had to hurry, and I was not worrying about the correct syntax, just pasted the appropriate lines. Pirate Wink
Sooke, Paul showed you the correct syntax.
Thanks Paul 4 the correction! Smile

Best regards,
Webmaster33
P.S.: Gone to girlfriend Wink Tongue

Last edited by:

webmaster33: May 12, 2002, 8:48 AM
Quote Reply
Re: [Paul] Browser Display In reply to
Thanks Paul, I now have:



Code:
sub {

my $tags = shift;
$tags->{title_linked} = Links::Build::build ('title_linked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
$tags->{title} = Links::Build::build ('title_unlinked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
return $tags;

}





Still won't compile Unsure

Do you think $tags->{title_linked} needs to be $tags->{'title_linked'}?

Last edited by:

sooke: May 12, 2002, 8:47 AM
Quote Reply
Re: [webmaster33] Browser Display In reply to
That ok webmaster, I really appreciated the assistance Smile

What does this mean in your signoff webmaster? Lucky man.
Quote:
P.S.: Gone to girlfriend Wink Tongue




Its Mothers day here, and I am off to see my mom :-) but I will be back!!

Last edited by:

sooke: May 12, 2002, 8:55 AM
Quote Reply
Re: [sooke] Browser Display In reply to
What is the error?

You'll probably need to add:

require Links::Build;
Quote Reply
Re: [sooke] Browser Display In reply to
No problem, good luck with the partial code. Just a few steps 2 the success.

Yep, I feel lucky. She's nice! Wink
Bye, see U tomorrow.


Hey, yesterday I found this nice typing help tool (UltimaShell for Windows). Very impressive & helpful typing tool for forum users, Word users, or even for programmers!
Check it here: http://www.flashpeak.com/ushell/ushell.htm

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [Paul] Browser Display In reply to
Quote:
Technical Message Follows: -------------------------- GT::Config (98824): Unable to compile 'title_linked' in file '/blahblah/cgi-bin/admin/templates/yahoo/globals.txt': at /s/blahblah/cgi-bin/admin/GT/Template.pm line 461.


I now have:

Code:


sub {

my $tags = shift;

require Links::Build;

$tags->{'title_linked'} = Links::Build::build ('title_linked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
$tags->{'title'} = Links::Build::build ('title_unlinked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
return $tags;

}
Quote Reply
Re: [webmaster33] Browser Display In reply to
Hey cool looking tool!



I had really get going and see my mom (mum)! See you guys in a few hours maybe.... hopefully I can get this global worked out.

Thanks Paul and webmaster.
Quote Reply
Re: [sooke] Browser Display In reply to
You need to change $category->{something} to $tags->{something} (twice) and $opts->{something} to $tags->{something} (also twice).

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Browser Display In reply to
Hi Ivan, Thanks! It compiles as a global now, but the tag <%title_linked%> which I called the global just returns blank.

Weird, or something I have done wrong perhaps.

I placed the tag <%title_linked%> into browser_category.html.

Last edited by:

sooke: May 12, 2002, 4:44 PM
Quote Reply
[suggestion] Full Category in Browser In reply to
I found this also:

Quote:


$category->select ( { ID => $category_id }, ['ID', 'Name', 'Number_of_Links'] )

add ... $category->select ( { ID => $category_id }, ['ID', 'Name', 'Number_of_Links', 'Full_Name'] )

... than at ... $self->print_template ( "browser_category.html",

add ... Long => $info->{Full_Name},

... and in /templates/admin/browser_category.html

Change the second "Browse: <%Name%>" ... to ... "Browse: <%Long%>"


But unfortunately this requires modification to browser.pm. Which is something I don't want to do.

I notice there are some old posts (2000ish) about putting this into Links. It looks like it would be a simple inclusion from the above code.

I would like to see this included in an upgrade with three possibilities:

Short Title: Travel and Tourism

Long Title: Travel and Tourism / Lodging / Bed and Breakfasts / Ontario / North Bay

Condensed Title: Travel and Tourism /.../Ontario/North Bay

The condensed title would allow length category titles to fit onto the screen without wrapping - say top category and last two categories, thats enough to know where you are usually.

I believe these are essential to editing, especially when you have multiple categories, and even more so if these categories have the same name!



In the mean time, I'd like to try and get this global working :-)

Last edited by:

sooke: May 12, 2002, 7:01 PM
Quote Reply
Re: [sooke] Browser Display In reply to
Hi Sooke,

Sorry for the late reply, you know I was busy yesterday Wink
Here is the global code that will work. Although I did not try out, I'm 99% Wink sure it will work.


Code:
sub {
my $tags = shift;
require Links::Build;

$tags->{'title_linked'} = Links::Build::build ('title_linked', $tags->{Full_Name});
$tags->{'title'} = Links::Build::build ('title_unlinked', $tags->{Full_Name});
return $tags;
}


In Reply To:
Short Title: Travel and Tourism
Long Title: Travel and Tourism / Lodging / Bed and Breakfasts / Ontario / North Bay
Condensed Title: Travel and Tourism /.../Ontario/North Bay
Your suggestions are possible, but I will not work on this right now.
However may be implemented in my Extended links plugin, if you agree with this.

I would name the tags you suggested as following:
Linked Short Title (not available currently): title_linked_short
Linked Long Title: title_linked = title_linked_long (means we would have both tags)
Linked Condensed Title: title_linked_condensed

UnLinked Short Title: already available as <%Name%>
UnLinked Long Title: title_unlinked = title_unlinked_long (as I know, we have something similar
in <%title%> tag)
UnLinked Condensed Title: title_unlinked_condensed

Opinions are welcome!

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Browser Display In reply to
Hi Webmaster,

Glad you could make it back!Tongue

The global now compiles great... but it displays nothing... blank in output. I called the global title_linked and placed it into browser_category.html at the top near the old "Browse: <%Name%>". Any ideas?

Quote:


Linked Short Title (not available currently): title_linked_short
Linked Long Title: title_linked = title_linked_long (means we would have both tags)
Linked Condensed Title: title_linked_condensed

UnLinked Short Title: already available as <%Name%>
UnLinked Long Title: title_unlinked = title_unlinked_long (as I know, we have something similar
in <%title%> tag)
UnLinked Condensed Title: title_unlinked_condensed


I agree with this, sounds very good, and useful too! I am sure my editors would be happy to see this.
Quote Reply
Re: [sooke] Browser Display In reply to
Oh, you use in browser_category.html ??? I just forgot.
Please place the following tag into the template above,
<%GT::Template::dump%>

Then save the html file for your later reference.
This will show you, which tags can you use in your current template.

Check if you have the Full_Name tag available and if it has a category name, like: Computers/Accessories.
If the tag not exists at all, we are in trouble. Laugh

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 13, 2002, 12:08 AM
Quote Reply
Re: [webmaster33] Browser Display In reply to
We could be in trouble... should I have Full Name in this template?

I have:

title (this is blank)

title_linked <a href="http://www.mysite.com/index.html">Home</a> :



Notice title is blank.

I also have "Name" which is showing correctly: Language Schools, which I am currently in. Notice title_linked above does not refelct Langauge Schools, rather the Home category only.

Will this global work in a dynamic template like browser_category.html?

Last edited by:

sooke: May 13, 2002, 12:14 AM
Quote Reply
Re: [sooke] Browser Display In reply to
In Reply To:
Will this global work in a dynamic template like browser_category.html?
Does not matter on this. Should work anyway. Especially in dynamic mode.

We have at least a category id tag or something similar tag?

Quote:
"Name" which is showing correctly: Language Schools
That means we should have category id tag or ID tag, etc.
If there is, then would be possible to find categories above and make the correct title_linked.

But I'm afraid, this will not a 5 minute problem for me, and would need some active tests on my local webserver, and currently I can not afford too much time for this task.
If this is not a very-quickly-required task, I would suggest you to continue solving this problem another time. Maybe some experts will help you out in the meantime.
Have to go back to work, but from time to time I will watch the thread.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 13, 2002, 12:37 AM
Quote Reply
Re: [webmaster33] Browser Display In reply to
Thanks webmaster. You have been a great help.

I will have another look at this tommorow.Smile
Quote Reply
Re: [sooke] Browser Display In reply to
The problem is that "Full_Name" is not a tag on the "browser_category.html" template. What you can use is $tags->{category_id} (which contains the ID of the category in question).

Your global should therefore first load the category from the database, and then it can do what you already have....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Browser Display In reply to
Interestingly enough, after making those changes I get values in <%GT::Template::dump%>:



title 15226

title_linked <a href="http://www.mysite.com/index.html">Home</a> : 15226



but the output is still blank on the screenCrazy for either <%title_linked%> or <title> in browser_category.html.

Also, the father for this category is NOT home, rather another category.

Is there something else required in the "return $tags;" to make it print? This is the first global I have run into problems like this with.

Last edited by:

sooke: May 13, 2002, 1:05 AM
Quote Reply
Re: [sooke] Browser Display In reply to
I did not mean to say that you can use $tags-{category_id} instead of $tags->{Full_Name}.

You need to do a select from category database where ID equals $tags->{category_id} sort of thing. The resulting record hashref, let's call it $cat, can then be used as $cat->{Full_Name}

Does that make sense?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Browser Display In reply to
Yes, I am following now! thanks.

Must be getting tired! Blush
Quote Reply
Re: [sooke] Browser Display In reply to
Hi,

You could do this with something like:

Code:
sub {
my $tags = shift;
my ($full_name) = $DB->table('Category')->select('Full_Name', { ID => $tags->{category_id} })->fetchrow;
require Links::Build;
my $title = Links::Build::build('title_linked', $full_name);
return $title;
}


The problems in the various solutions were:
  • title_linked is not available in the category browser by default
  • when you return a hash reference, the program makes those new tags active, but your code does not print anything out. So when you did <%some_global%>, it would just activate the <%title_linked%> tags later.


Hope that helps,

Alex
--
Gossamer Threads Inc.
> >