MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

UserTag's not interpoating...



******    message to minivend-users from "Jeff Carnahan" <tails@dakotacom.net>     ******

I've recently setup a UserTag named 'utCommonHeader' which reads in the
contents of a file (Yes, I have already enabled the open function via a
AllowGlobal declaration in the main minivend config file), parses a few
statements out of it, and returns it to the HTML page....

No matter how many ways I can think of making this work, I can't seem to
get Minivend interpolate the tags..

Here's it's declaration:

UserTag utCommonHeader HasEndTag 1
UserTag utCommonHeader Interpolate 1
UserTag utCommonHeader Order title
UserTag utCommonHeader Routine <<EOF
	sub {
		my ($Title, $Contents) = @_;
		my $File = '/path/common-header.html';
		my $Output;

		HEADER: {
			open(Vend::HEADER,"$File") or last HEADER;
			while (<Vend::HEADER>) {
				s/%title%/$Title/ig;
				s/%contents%/$Contents/ig;
				$Output .= $_;
			}
			close Vend::HEADER or last HEADER;
		}

		logError("Unable to open header file for reading:\nFile: $File\n") if
($?);

		$Output;
	}
EOF

And implementation in a minivend parsed page:

[utCommonHeader title="My Title"]
	Some other stuff...
[/utCommonHeader]

Any suggestions?

--
Warmest Regards...
__________________________________________________________________
Cyberscope, Inc.                                     Jeff Carnahan
Online Internet Commerce                       jeff@cyberscope.com
http://www.cyberscope.com/                     tails@dakotacom.net
__________________________________________________________________


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: