[interchange] * Add new UserTag parameter "Underride". This allows you to define

Mike Heins <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 0d0fe200c7933322372aafd3cf3caee9dea15642
Author: Mike Heins <[email protected]>
Date:   Sat Mar 22 11:55:57 2014 -0400

    * 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.)

 lib/Vend/Config.pm |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm
index 17cc467..86a63f5 100644
--- a/lib/Vend/Config.pm
+++ b/lib/Vend/Config.pm
@@ -255,6 +255,7 @@ for( values %extmap ) {
 	cannest			canNest
 	description  	Description
 	override	  	Override
+	underride	  	Underride
 	visibility  	Visibility
 	help		  	Help
 	documentation	Documentation
@@ -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'");
@@ -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/-/_/;
@@ -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};
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.