Gossamer Forum
Home : Products : Links 2.0 : Customization :

Format of Description

Quote Reply
Format of Description
How can I delimit the description-field to one or to lines, but only in link.html?

<%if Description%>
<span class="descript"> <Þscription%></span>
<%endif%>

How can I use an if description with another field, for example:
<%if Description%>
<%if date="*-May-2000"%>
<span class="descript"> <Þscription%></span>
<%endif%>
<%endif%>


Is something like that possible

Quote Reply
Re: Format of Description In reply to
What I would suggest doing for nested conditional statements is the following:

1) Add the following codes in the sub site_html_link routine:

Code:
$date = &get_date;
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Date'} eq "$date")) {
$description .= qq|$wrap|;
}
else {
$description .= qq|No Description|;
}

2) Then define the description tag as follows:

Code:

description => $description


3) Then in your link.html file, add the following codes:

Code:

<Þscription%>


For the line wrapping...see the above codes in blue. Then in your sub linewrap routine in the db_utils.pl, change my $columns = 60; to my $columns = 255;. (Change 255 to the number of your maximum length column for the Description field.

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Thanks for your code, but I does't get it run, what is meant with

<Þscription%>

Chris

Quote Reply
Re: Format of Description In reply to
That is the tag that you use in your link.html....

For some reason, the forum corrupts some of the tag codes...

It should be (without spaces):

< % description%>

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Ok, thats I thought about, so thats not the fault, I tried out this:
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq|No Description|;
}



##### END DESCRIPT #############

my %rec = @_;

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});


return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}

But that doesn't work also?!
Chris

Quote Reply
Re: Format of Description In reply to
Code:
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq|No Description|;
}



##### END DESCRIPT #############
These codes need to go after the my %rec = @_; codes.

In Reply To:
But that doesn't work also?!
Because of the following:

1) You did not put the codes in the correct spot in the sub.
2) You did not define the tag after the following codes:

Code:
return &load_template ('link.html', {
As stated above....You need to define the tag in order to use it in your link.html!!

Like the following:

Code:
description => $description,
Then you can use the tag that I provided twice already in this Thread:

Code:
< % description%>
WITHOUT the spaces!

Regards,


Eliot Lee
Quote Reply
Re: Format of Description In reply to
Ok, that was my fault, i added the description => $description, in %globals.

That works, but now, I get the <Þscription%> at all links at that page, that seems so:

Test t-online.de neu pop
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -
TEst Eventorga neu
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -kujbbljb
cs.com 123 neu
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -kujbbljbNo Description
TEST consors 2 neu
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -kujbbljbNo DescriptionNo Description

Whats wrong?


Quote Reply
Re: Format of Description In reply to
Yes...it is working...DO you see the lines with No Description??????

That means it is working!

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
But the BESCHREIBUNG befor are always the description of the first link in the list.

I don't know, how to get that out?

Chris

Quote Reply
Re: Format of Description In reply to
I don't understand.

In which field do you have Beschreibung???

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Everything before No Description is not ok there for the 3rd Link:

1. Test t-online.de neu pop
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -
2. Test Eventorga neu
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -kujbbljb
3. cs.com 123 neu
Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung - Beschreibung -Beschreibung -Beschreibung -Beschreibung -kujbbljbNo Description


Quote Reply
Re: Format of Description In reply to
I still don't understand...Sorry.

Please provide a link to your LINKS directory, so that I can see what you are talking about...the lines of text you provided SHOW me nothing relevant that may help me to help you.

Thank you!

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Ok, here is an example:
http://www.guxme.de/Verzeichnis/Showbiz/Eventorganisation/

In link.html I have:
<table>

<tr>

<td>

<%if Graphic%>

<img src="http://www.guxme.de/links/images/prio.jpg" border="0">

<%endif%>

</td>

<td>

<a href="<Û_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank" class="link"><b><%Title%></b></a>

<%if isNew%>

<sup class="new"><font size=-1>neu</font></sup>

<%endif%>

<%if isPopular%>

<sup class="pop"><font size=-1>pop</font></sup>

<%endif%>




#<%if description%>

# <span class="descript"> <Þscription%></span>

#<%endif%>

<%if Description%>

<span class="descript"> <Þscription%></span>

<%endif%>

</td>

</tr>

</table>

In site_html_template.pl I have:

# This routine is used to display what a link should look
# like.
my %rec = @_;
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq||;
}
##### END DESCRIPT #############

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});


return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
description => $description,
%rec,
%globals
});
}



Quote Reply
Re: Format of Description In reply to
You have the WRONG codes in your link.html file!

Delete these codes:

Code:

#<%if description%>
# <span class="descript"> <Þscription%></span>
#<%endif%>
<%if Description%>
<span class="descript"> <Þscription%></span>
<%endif%>


You only need to use the following tag as I STATED before:

Code:

<Þscription%>


NO if and NO endif tags!

Do you understand now?????

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
mea culpa, thats exreamly stupid!

Sorry and thanks Eliot

Quote Reply
Re: Format of Description In reply to
what's extremely stupid??

My suggestion or your mistake???

You're welcome...I think.

Wink

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Sorry, I meant my mistake, but now I found out, it doesn't fit.

May you look at this once more, please:


In site_html_templates I have:
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my %rec = @_;
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq||;
}
##### END DESCRIPT #############


In link.html I have:
<table>
<tr>
<td>
<%if Graphic%>
<img src="<%build_root_url%>/prio.jpg" border="0">
<%endif%>
</td>
<td>
<a href="<Û_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank" class="link"><b><%Title%></b></a>
<%if isNew%><sup class="new"><font size=-1>neu</font></sup>
<%endif%>
<%if isPopular%><sup class="pop"><font size=-1>pop</font></sup>
<%endif%>


<Þscription%>
</td>
</tr>
</table>


If I use this with a big 'D', it works, but without the if-then-case!


The result you see at:
http://www.guxme.de/Verzeichnis/Showbiz/Eventorganisation/

BUT the text: "Descirption of 'Test t-online.de'-Descirption of 'Test t- online.de'-Descirption of 'Test t-online.de'-Descirption of 'Test t-online.de'" is ONLY stored at link 100004??! There must be a loop or a wront counter or something like that, so he adds one descriftion to another and print it to every folowing item!?!?!?!

Do you have another idea?

Thanks, Chris

Quote Reply
Re: Format of Description In reply to
Because you have NOT followed all the steps I provided!!!!!!!!!

You need to define the description tag as follows:

Code:

description => $description


for the third time!!

And then you can use the small description tag in your link.html file!!!!

*sigh*

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Hi Eliot,

I have defined it, but I'm not sure if it's at the right place, here it is:
my %rec = @_;
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq||;
}
##### END DESCRIPT #############

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});


return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
description => $description,
%rec,
%globals
});
}

Quote Reply
Re: Format of Description In reply to
Now it is in the RIGHT PLACE AND SHOULD WORK!

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Hi Eliot, it should, but as you see here:
http://www.guxme.de/Verzeichnis/Showbiz/Eventorganisation/
it doesn't work, because the Links without a TOP-Symbol are followed by a description, what shouldn't be.

You habe any other idea?????

Thanks a lot,

Chris

Quote Reply
Re: Format of Description In reply to
Since you have screwed up the codes I have provided more than once...I betcha you have messed something up yet again.

I would recommend carefully reading through the Replies I have provided and re-apply the codes I've given you!

Regards,

Eliot Lee
Quote Reply
Re: Format of Description In reply to
Sorry, Eliot, I've checked everything, but I cannot find a mistake. I think, there is something wrong with teh $wrap, because I can change anything, the $wrap does an addition of al Description-fields of one page.

My last Version is:
my %rec = @_;
##### BEGIN DESCRIPT ########
$wrap = &linewrap($rec{'Description'});
if (($rec{'Description'}) && ($rec{'Priority'} eq "Yes")) {
$description .= qq|$wrap|;
}
else {
$description .= qq|No Description|;
}
##### END DESCRIPT #############

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});


return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
description => $description,
%rec,
%globals
});
}