Template-Plexsite

 view release on metacpan or  search on metacpan

lib/Template/Plexsite.pm  view on Meta::CPAN

  

  # URL table
	my $table=$self->args->{table}->table;

  # Table entry
	my $entry=$table->{$self->args->{plt}};

  \my %config=$entry->{template}{config};
  # Split the path and navigate to the level
  my @part=split m|/|, $options{path};

  my $parent=$config{nav}; #Root of nav object
  my $inc_path="";
  for my $part (@part){
    $parent = $parent->{$part}//={
      _data => {
        path=>$inc_path
      }
    };
    $inc_path .= "/";

script/build-menu.pl  view on Meta::CPAN

	my $template=plex $input."/".$src, $configs{$input}, %opts;
	my $result=$template->setup;#render;

	#If Output variable is set, we can add it to the list
	if($config{output}{location}){
		#Process menu entry if required
		#
		if($config{menu}){
			Log::OK::DEBUG and log_debug "Template sets a menu entry. Adding to navication";
			#Split the menu item
			my @parts=split m|/|, $config{menu}{path};
			Log::OK::DEBUG and log_debug "Menu path will be: ", join ", ", @parts;
			my $parent=$config{nav};

			for(@parts){
				$parent = $parent->{$_}//={};
			}

			$parent->{_data}{href}//=$input;

			for( keys $config{menu}->%*){



( run in 2.050 seconds using v1.01-cache-2.11-cpan-71847e10f99 )