Gossamer Forum
Home : Products : Gossamer Links : Discussions :

isDetailed, Detailed pages only when set to Yes

Quote Reply
isDetailed, Detailed pages only when set to Yes
Hi Alex, hi all.

Is this the right and best way to reduce building detailed pages only when a var is set to Yes:

New field for table Links: Detailed, enum, Yes/No
In nph-build.cgi

Code:
sub _build_detailed {
my ($cond, $cond2, $cust_page, $cust_limit);
...
$cond ||= new GT::SQL::Condition;
$cond->add ('isValidated', '=', 'Yes');
$cond2 ||= new GT::SQL::Condition;
$cond2->add ('Detailed', '=', 'Yes');



This seems to run for me. But i would like to have more comfort:
I want to have a field Detailed for the table category ; if known that for all the links in this cat, there is no detailed wished.

Robert


Ok, here we go: Changes for the next and prev_url:
In Links/Build.pm

Code:
sub build_detailed {
...
my $sth = $catlnk_db->select ( { CategoryID => $cat_id, isValidated => 'Yes', Detailed=> 'Yes' }, [ 'Links.ID' ] );

Last edited by:

Robert: Feb 17, 2002, 3:01 AM
Quote Reply
Re: [Robert] isDetailed, Detailed pages only when set to Yes In reply to
I think this:

$cond ||= new GT::SQL::Condition;
$cond->add ('isValidated', '=', 'Yes');
$cond2 ||= new GT::SQL::Condition;
$cond2->add ('Detailed', '=', 'Yes');

could be:

$cond ||= new GT::SQL::Condition;
$cond->add ('isValidated', '=', 'Yes', 'Detailed', '=', 'Yes');

Last edited by:

RedRum: Feb 17, 2002, 3:13 AM
Quote Reply
Re: [RedRum] isDetailed, Detailed pages only when set to Yes In reply to
Hey RedRum, thank you.

So the sql is divided: where abc = yxz -> 'abc', '=', 'yxz';
but how is the AND / OR passed:

where abc = '1' AND abc2 = '2'
---> abc, =, 1 , abc2, = ,2
(left the ')

What should i do with
where a =1 OR where b = 2 ?

Robert
Quote Reply
Re: [Robert] isDetailed, Detailed pages only when set to Yes In reply to
Go into the admin panel and click "Help" on the right.

Scroll down to "GT Module Documentation" and then scroll down to "GT > SQL > Condition"

That should help :)
Quote Reply
Re: [Paul] isDetailed, Detailed pages only when set to Yes In reply to
In Reply To:
I think this:

$cond ||= new GT::SQL::Condition;
$cond->add ('isValidated', '=', 'Yes', 'Detailed', '=', 'Yes');


I am trying this:
$cond ->add ('isValidated', '=', 'Yes', 'LinkType', '=', 'CompInfoNews');

But I still get a build on all entries with a detailed page

I do not want to build detailed pages for all of entries, just those associated with CompInfoNews

BTW making progress on my project - thanks to all - http://www.yachtcom.com
Quote Reply
Re: [gatman] isDetailed, Detailed pages only when set to Yes In reply to
You could actually use the pagebuilder plugin to do this.

Add a 'link' type page, and in 'page conditions', put

isValidated = Yes LinkType = CompInfoNews

Then for every link that satisfies the condition, a page is built. You could then turn off the built in detaild pages.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] isDetailed, Detailed pages only when set to Yes In reply to
 
OK - Understood

Now I just have to ensure that the page condition is met - it's not executing BOTH conditions

isValidated = Yes LinkType = CompInfoNews

I removed isValidated and it did pick up on CompInfoNews - should there be an "and" between them?

Last edited by:

gatman: Jan 29, 2003, 4:25 AM
Post deleted by gatman In reply to

Last edited by:

gatman: Jan 29, 2003, 4:07 AM
Quote Reply
Re: [gatman] isDetailed, Detailed pages only when set to Yes In reply to
I was having the same problem satisfying BOTH conditions.

I changed mine to this, and it now works:

Code:
$cond = GT::SQL::Condition->new(
'isValidated', '=', 'Yes',
'BuildDetailed', '=', 'Yes'
);

Last edited by:

Katana Man: Mar 17, 2003, 7:30 PM
Quote Reply
Re: [Katana Man] isDetailed, Detailed pages only when set to Yes In reply to
Yogi's Page Builder really worked well for us in this regard.