CGI-Application-Plugin-PageLookup

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/PageLookup.pm  view on Meta::CPAN


This is a string defining the character encoding. This defaults to 'utf-8'.

=item template_params

This is a hashref containing additional parameters that are to be passed to the load_templ function.

=item default_lang

This is a two letter code and defaults to 'en'. It is used when creating a notfound page when a language
cannot otherwise be guessed.

=item status_404

This is the internal id corresponding to the not found page.

=item msg_param

This is the parameter used to store error messages.

=item xml_sitemap_base_url

lib/CGI/Application/Plugin/PageLookup.pm  view on Meta::CPAN

and implement your own logic.

=cut

sub pagelookup_notfound {
   my $self = shift;
   my $page_id = shift;
   my @inargs = @_;
   my %args = $self->pagelookup_get_config(@inargs);

   # Best guess at language
   my $lang = $self->pagelookup_default_lang(@inargs);
   if ($page_id =~ /^(\w\w)\//) {
	$lang = $1;
   }

   my $template = $self->pagelookup({lang=>$lang, internalId => $self->pagelookup_404}, handle_notfound=>0) || croak "failed to construct 'not found' page";
   $template->param( $self->pagelookup_msg_param(@inargs) => $page_id);
   $self->header_add( -status => 404 );
   return $template;



( run in 0.604 second using v1.01-cache-2.11-cpan-748bfb374f4 )