Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Add new UserTag parameter "Underride". This allows you to define
  a new UserTag for use, then later have that tag become part of
  the distribution Interchange without causing errors.

  Has the effect of ignoring the second definition of a tag
  if that tag begins its stanza with

  	UserTag  tagname  Underride

  Intended for allowing a new "strap" template admin and catalog
  template with a few new UserTag definitions distributed with
  the template, then have those tags be superseded by distribution
  Interchange tags. (The first of those is ts/tn/tv, for defining
  page titles, ephemeral JavaScript code, etc.)
  • Loading branch information
perusionmike committed Mar 22, 2014
1 parent 6da1aa4 commit 0d0fe20
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/Vend/Config.pm
Expand Up @@ -255,6 +255,7 @@ for( values %extmap ) {
cannest canNest
description Description
override Override
underride Underride
visibility Visibility
help Help
documentation Documentation
Expand Down Expand Up @@ -5050,7 +5051,7 @@ sub parse_mapped_code {
get_system_code() unless defined $SystemCodeDone;
my($tag,$p,$val) = split /\s+/, $value, 3;
# Canonicalize
$p = $tagCanon{lc $p} || ''
or ::logDebug("bizarre mapped code line '$value'");
Expand Down Expand Up @@ -5130,7 +5131,7 @@ sub parse_tag {
config_warn("Bad user tag parameter '%s' for '%s', skipping.", $p, $tag);
return $c;
}
# Canonicalize
$p = $tagCanon{lc $p};
$tag =~ tr/-/_/;
Expand All @@ -5140,7 +5141,15 @@ sub parse_tag {
if ($tagSkip{$p}) {
return $c;
}
if($p eq 'Underride') {
if($Global::UserTag->{Routine}->{$tag} or $C && $C->{UserTag}->{Routine}->{$tag}) {
$c->{Done}{$tag} = 1;
}
}
return $c if $c->{Done}{$tag};
if($CodeDest and $CodeDest eq 'CoreTag') {
return $c unless $Global::TagInclude->{$tag} || $Global::TagInclude->{ALL};
}
Expand Down

0 comments on commit 0d0fe20

Please sign in to comment.