PDA

View Full Version : Create meta tags in the <HEAD> section?


Neocoder
04-20-06, 10:40 PM
Hi -
I'm working on a site that creates a page by McCALLing files in different languages, based on user selections via an HTML form.

Some of the languages require special fonts. I'd like to be able to do a test
<MvIF> Language is Chinese, and if it is, create meta tags that look like this:
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta http-equiv="Content-Language" content="zh-cn">

Since I normally don't start Miva until the <body> section, I am at a loss as to how to change <HEAD> settings. Is it possible?

Would these tags work in the <BODY>?

Thanks!

Vic - WolfPaw Computers
04-20-06, 10:43 PM
Which version of MIVA Merchant are you using?

Is it MMUI or OpenUI?

Neocoder
04-21-06, 07:16 AM
I'm writing code with Miva Empressa 3.9700.

This project isn't part of my merchant site, which is Miva 5. I just signed up for Merchant this week and haven't developed my store yet.

Vic - WolfPaw Computers
04-21-06, 07:26 AM
If you are developing for MIVA Merchant 5, you will need Empresa 5.03 or better.

You could edit the templates in MM5 to call your function or script as part of the head tag item.

Neocoder
04-21-06, 04:24 PM
That's good to know, but I'm not developing for MIVA Merchant 5 right now. I'm just developing a site to display documents in several langages. The site isn't in a Merchant environment.

My challenge is how to pass the <head> information with the language font meta tag to the page MIVA is building.

Vic - WolfPaw Computers
04-21-06, 04:54 PM
That's good to know, but I'm not developing for MIVA Merchant 5 right now. I'm just developing a site to display documents in several langages. The site isn't in a Merchant environment.

My challenge is how to pass the <head> information with the language font meta tag to the page MIVA is building.

I understand the application...but isnt your application you are writing creating the HTML output?

In Merchant, the HEAD data is created in the MMUI.MV script. Since you are not using Merchant, where is the HTML output created from?

Neocoder
04-21-06, 05:11 PM
Yes, Miva is creating the HTML output including the <header>. My problem is that I don't have the information to hard code this meta tag, which varies with every language.

The document I'm MvCALLing has the correct meta code in its own <head>. But I'm not passing that document's <head> through because MIVA has created a new <head> for my document.

What I'd like to be able to do is to test their <head> as it comes in, and only print out the lines that are relevant to language info. Each of these lines happens to start with <meta http-equiv= ...

So the code I've tried is

<MvIF EXPR="{substring(callvalue, 2, 16) EQ "meta http-equiv=">
WRITE META TAG
</MvIF>

But it isn't working. This is the first time I've used the substring function. Am I applying it incorrectly? Or is there another function that would work better?

Vic - WolfPaw Computers
04-21-06, 05:23 PM
Ok, you mean Empresa is creating the tags. Ok. MIVA is a company...Empresa is the MIVAScript parsing engine. I misunderstood your meaning.

Your reference to callvalue should be s.callvalue

The result of an MvCALL is returned as a system string variable.

Neocoder
04-21-06, 07:19 PM
I apologize for the confusion. I'm new to scripting and am afraid I'm still in the "stupid mistakes" phase. :o

I modified the tag as you suggested and it is working.

Thanks for your help!

Vic - WolfPaw Computers
04-21-06, 07:41 PM
No problem :) Once I understood what you were actually doing.

Those dang variables are picky!

etu1972
05-04-06, 07:34 PM
Is there a way to insert meta tags for Miva 4 MMUI?

Vic - WolfPaw Computers
05-04-06, 07:35 PM
Not with any version of MIVA Merchant 4.14 or later. At least not with out the limited source kit and compiler.

You can however, with OpenUI, insert all kinds of META data in pages.

etu1972
05-04-06, 07:44 PM
Thanks. Is the limited source kit and compiler something that would adversely affect an existing MMUI store's configuration, etc.? If not, where would I find it and how tough to install? Is it like installing a mod?

Vic - WolfPaw Computers
05-04-06, 07:50 PM
The limited source kit runs $695 from MIVA, then you'd have to modify the source files, re-compile and upload over you're existing mmui.mvc.

You'll lose those changes if you upgrade versions of Merchant and have to re-edit, recompile and upload again.

Or you can simply invest the $$ in OpenUI Advanced (http://www.mivacentral.com/Merchant2/merchant.mv?Screen=PROD&Store_Code=m&Product_Code=OPENUI-ADVANCED&ref=WPAW) for less than 1/3rd the cost of the source kit and get many other added features as well.

Fairly simple to install, just be sure to follow the directions! You risk losing your stores look & feel settings if you fail to follow instructions on how to back them up before switching layouts.

mvmarkus
05-27-06, 03:29 PM
So the code I've tried is

<MvIF EXPR="{substring(callvalue, 2, 16) EQ "meta http-equiv=">
WRITE META TAG
</MvIF>

But it isn't working. This is the first time I've used the substring function. Am I applying it incorrectly? Or is there another function that would work better?


Try
<MvIF EXPR = "{ s.callobjectelement EQ 'meta' AND s.callobjectattribute[1] EQ 'http-equiv' }">
<B>WRITE META TAG </B>
</MvIF>

This may work better.

Also, look at the manual about MvCALL, it really offers a lot of functionality

http://smallbusiness.miva.com/support/docs/ScriptGuide_html/ScriptGuide.html#490921

Hope that helps,

Markus