Name

SearchProfile — specify files containing search profile definitions

SYNOPSIS

filename...

DESCRIPTION

The directive specifies filenames that contain search profile definitions.

An unlimited number of search profiles can be set up, performing complex searches on a single user click. At the same time, separately-defined search profiles keep your HTML pages cleaner.

As said, multiple profiles can be defined, and within the same file. In that case, profiles must be separated by __END__ tokens. Each opening __NAME__ token should be left-aligned, and each __END__ should be on a line by itself, with no leading or trailing whitespace.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Defining SearchProfile

SearchProfile etc/profiles.search etc/search.profiles

NOTES

For a complete discussion, see profile glossary entry.

AVAILABILITY

SearchProfile is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0:

Source: lib/Vend/Config.pm
Line 696

['SearchProfile',   'profile',        ''],

Source: lib/Vend/Config.pm
Line 4797 (context shows lines 4797-4838)

sub parse_profile {
my ($var, $value) = @_;
my ($c, $ref, $sref, $i);

if($C) {
  $C->{"${var}Name"} = {} if ! $C->{"${var}Name"};
  $sref = $C->{Source};
  $ref = $C->{"${var}Name"};
  $c = $C->{$var} || [];
}
else {
  no strict 'refs';
  $sref = $Global::Source;
  ${"Global::${var}Name"} = {}
     if ! ${"Global::${var}Name"};
  $ref = ${"Global::${var}Name"};
  $c = ${"Global::$var"} || [];
}

$sref->{$var} = $value;

my (@files) = glob($value);
for(@files) {
  next unless $_;
  config_error(
    "No leading / allowed if NoAbsolute set. Contact administrator.\n")
  if m.^/. and $Global::NoAbsolute;
  config_error(
    "No leading ../.. allowed if NoAbsolute set. Contact administrator.\n")
  if m#^\.\./.*\.\.# and $Global::NoAbsolute;
  push @$c, (split /\s*[\r\n]+__END__[\r\n]+\s*/, readfile($_));
}
for($i = 0; $i < @$c; $i++) {
  if($c->[$i] =~ s/(^|\n)__NAME__\s+([^\n\r]+)\r?\n/$1/) {
    my $name = $2;
    $name =~ s/\s+$//;
    $ref->{$name} = $i;
  }
}

return $c;
}

AUTHORS

Interchange Development Group

SEE ALSO

Profiles(7ic), OrderProfile(7ic)

DocBook! Interchange!