Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%variable tag%> in the description field?

Quote Reply
<%variable tag%> in the description field?
Hi,

Want something to be done, and it doesn't work, would be great if anybody can help me.

I want to to include a variable in the description field of the category. This doesn't give me the output I expected.

(The <%variable tag%> is OK, cause when I put this on the home template, It gives the results!)

So the actual question is: Can I put a <%variable tag%> in the category description field? Seems that it won't be parsed, does anybody have a solution for that or is it simply impossible?

Thanks,
Ron
Quote Reply
Re: [rsahertian] <%variable tag%> in the description field? In reply to
No, you can't include tags in the database.

You could use a global to parse it - something like this - you'll need to use SUBSTITUTE in your description field where you want the value and then you'll need to use $subscription for the thing you want it replaced by - I assume you'll need to add some extra code to get the correct value for $subscription.

sub {

my $tags = shift;

my $description = $tags->{'Description'};

my $subsitution = "what ever you need";

$description =~ s/SUBSITUTE/$substitution/;

return $description;

}
Quote Reply
Re: [rsahertian] <%variable tag%> in the description field? In reply to
Check the Yahoo Subcats plugin for how to do what laura suggests.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [afinlr] <%variable tag%> in the description field? In reply to
Laura,

Have you (or anyone else) tried this? I would actually like to be able to parse the Link (not category) description field. I use LinksSQL as a content management system and it would be great if I could upload 3 images for example and then display them in the content using something like:

Quote:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
<%image1%>

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
<%image2%>

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
<%image3%>


Image 1 to 3 can either be globals or just tags if the whole field is parsed. Smile

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] <%variable tag%> in the description field? In reply to
I do do a lot of parsing of database fields - mainly to replace urls. I'm not sure this is the most efficient way of doing this but it should work:

<%parseddescription%>

sub {
my $tags = shift;
my $description = $tags->{'Description'};
my $image1 = qq~<img src="$tags->{'Image1'}">~;
my $image2 = qq~<img src="$tags->{'Image2'}">~;
my $image3 = qq~<img src="$tags->{'Image3'}">~;
$description =~ s/IMAGE1/$image1/;
$description =~ s/IMAGE2/$image2/;
$description =~ s/IMAGE3/$image3/;
return $description;
}

So you would put IMAGE1, etc in the Description field where you want the images - and I'm assuming that each image has its own field in the table.
Quote Reply
Re: [afinlr] <%variable tag%> in the description field? In reply to
Thanks Laura.

I'll give this a go. Smile

Safe swoops
Sangiro