File include in Miva?
I thought MvINCLUDE was implemented in one of the virtual
machine/compiler releases? Albeit it was buggy, I remember discussions
on it here in the list.
Bill Guindon wrote:
> On Thu, 3 Mar 2005 21:06:19 +0100, Ivo Truxa <[email protected]> wrote:
>
>>What's wrong with MvDO? This is exactly the task it is designed for.
>>Well, in Miva Script v4 (since v4.11) there is also MvINCLUDE.
>
>
> Ok, I'll change my comment to "It would be great if the had an
> 'include', and the actually documented it".
>
>
>>>Right, that's another reason I'd like an 'include', so I
>>>could create a 'library' script with common functions,
>>>and just 'include' those functions in any script.
>>>Saves the trouble of having to do MvDO all over the place.
>>
>>There is no need for even with MvDO. Just declare the functions once in each
>>file (just like in many other programming languages) and then you can call
>>them directly as much as you want. I have common libraries and use this
>>technique all over all my Miva Script files.
>
>
> You mean copy/paste the functions? Or wrap the MvDO with local functions?
>
> I can see that wrapping them makes them appear local, but it's a bit
> tedious. Does the above MvINCLUDE solve this? Guess I'm off to write
> a couple tests.
>
--
------------
"To The States, or any one of them, or any city of The States,
Resist much, obey little;
Once unquestioning obedience, once fully enslaved;
Once fully enslaved, no nation, state, city, of this earth,
ever afterward resumes its liberty."
~Walt Whitman
Announcement
Collapse
No announcement yet.
File include in Miva?
Collapse
X
-
Guest replied
-
Guest repliedFile include in Miva?
From: Bill Guindon [mailto:[email protected]]
> Ok, I'll change my comment to "It would be great if the had an
> 'include', and the actually documented it".
As many other new functions and features, it _is_ documented in the Release
Notes :) In Miva v4, reading the Notes is obligatory if you want to use all
its features. I believe Miva hired a new person who works on new
documentation, though anyway.
>> There is no need for even with MvDO. Just declare the functions once in
each
>> file (just like in many other programming languages) and then you can
call
>> them directly as much as you want. I have common libraries and use this
>> technique all over all my Miva Script files.
> You mean copy/paste the functions? Or wrap the MvDO with local functions?
Of course not, you then do not need any libraries :) As I wrote, simply just
declare the functions:
<MvFUNCTION...><MvDO..><MvFUNCRETURN...></MvFUNCTION>
<MvFUNCTION...><MvDO..><MvFUNCRETURN...></MvFUNCTION>
...
<MvFUNCTION...><MvDO..><MvFUNCRETURN...></MvFUNCTION>
> I can see that wrapping them makes them appear local, but
> it's a bit tedious.
No really. Takes just couple of lines at the top of each file. Fast and
easily done. Real includes would save the file access in run time, but on
the other hand they would then bloat the file size unnecessarily - if you
have libraries with big number of functions, where you usually use just a
limited part of them, including them in the above way may prove more
efficient.
Ivo
http://mivo.truxoft.com
Leave a comment:
-
Guest repliedFile include in Miva?
On Thu, 3 Mar 2005 21:06:19 +0100, Ivo Truxa <[email protected]> wrote:
> What's wrong with MvDO? This is exactly the task it is designed for.
> Well, in Miva Script v4 (since v4.11) there is also MvINCLUDE.
Ok, I'll change my comment to "It would be great if the had an
'include', and the actually documented it".
> > Right, that's another reason I'd like an 'include', so I
> > could create a 'library' script with common functions,
> > and just 'include' those functions in any script.
> > Saves the trouble of having to do MvDO all over the place.
>
> There is no need for even with MvDO. Just declare the functions once in each
> file (just like in many other programming languages) and then you can call
> them directly as much as you want. I have common libraries and use this
> technique all over all my Miva Script files.
You mean copy/paste the functions? Or wrap the MvDO with local functions?
I can see that wrapping them makes them appear local, but it's a bit
tedious. Does the above MvINCLUDE solve this? Guess I'm off to write
a couple tests.
--
Bill Guindon (aka aGorilla)
Leave a comment:
-
Guest repliedFile include in Miva?
What's wrong with MvDO? This is exactly the task it is designed for.
Well, in Miva Script v4 (since v4.11) there is also MvINCLUDE.
> Right, that's another reason I'd like an 'include', so I
> could create a 'library' script with common functions,
> and just 'include' those functions in any script.
> Saves the trouble of having to do MvDO all over the place.
There is no need for even with MvDO. Just declare the functions once in each
file (just like in many other programming languages) and then you can call
them directly as much as you want. I have common libraries and use this
technique all over all my Miva Script files.
Ivo
http://mivo.truxoft.com
-----Original Message-----
From: Bill Guindon
On Thu, 3 Mar 2005 13:49:48 -0500, Andrew Noce
<[email protected]> wrote:
> Hi Bill,
>
> I thought there was MvCall?
>
> Forget what it does, though...
>
> Different from ?
It has it's limitations, and I'm not so sure it's the most efficient
way to do things. It can only access files that are on the web (so
you can't hide 'partial' pages in your data dir), and it loops through
them parsing for tags as it goes. So yeah, would work, just not as
'clean' a solution as a simple 'include' would be.
> In VBSCRIPT, you can use standard includes, as shown above, or...
>
> File_name = "filename.ext"
> Server.execute(File_name)
>
> ... in case you want to get dynamic about it. Whether a good thing or
> bad thing, variables in the executed files are scoped locally for that
> files execution and pooled database connections cannot be used. A new
> instance of everything must be established.
Right, that's another reason I'd like an 'include', so I could create
a 'library' script with common functions, and just 'include' those
functions in any script. Saves the trouble of having to do MvDO all
over the place.
Leave a comment:
-
Guest repliedFile include in Miva?
On Thu, 3 Mar 2005 13:49:48 -0500, Andrew Noce
<[email protected]> wrote:
> Hi Bill,
>
> I thought there was MvCall?
>
> Forget what it does, though...
>
> Different from ?
It has it's limitations, and I'm not so sure it's the most efficient
way to do things. It can only access files that are on the web (so
you can't hide 'partial' pages in your data dir), and it loops through
them parsing for tags as it goes. So yeah, would work, just not as
'clean' a solution as a simple 'include' would be.
> In VBSCRIPT, you can use standard includes, as shown above, or...
>
> File_name = "filename.ext"
> Server.execute(File_name)
>
> ... in case you want to get dynamic about it. Whether a good thing or
> bad thing, variables in the executed files are scoped locally for that
> files execution and pooled database connections cannot be used. A new
> instance of everything must be established.
Right, that's another reason I'd like an 'include', so I could create
a 'library' script with common functions, and just 'include' those
functions in any script. Saves the trouble of having to do MvDO all
over the place.
--
Bill Guindon (aka aGorilla)
Leave a comment:
-
Guest repliedFile include in Miva?
Hi Bill,
I thought there was MvCall?
Forget what it does, though...
Different from ?
In VBSCRIPT, you can use standard includes, as shown above, or...=20
File_name =3D "filename.ext"
Server.execute(File_name)
... in case you want to get dynamic about it. Whether a good thing or
bad thing, variables in the executed files are scoped locally for that
files execution and pooled database connections cannot be used. A new
instance of everything must be established.
Andrew=20
=20
> -----Original Message-----
> From: Bill Guindon [mailto:[email protected]]=20
> Sent: Wednesday, March 02, 2005 11:12 PM
> To: Alex Brodsky
> Cc: miva-users
> Subject: Re: [meu] File include in Miva?
>=20
>=20
> > -----Original Message-----
> > To: [email protected]
> > Subject: [meu] File include in Miva?
>=20
> > I understand that both MVCALL (OUI's %CALL%) and OUI's=20
> %INCLUDE% can=20
> > load
>=20
> umm, I'll be the first (perhaps the only) one to suggest that=20
> OUI and MEU should not mix. Best to send that to Merchant=20
> users, or Merchant coders. (I feel your pain, but I'll not=20
> mention your name)
>=20
> if it helps any, I would _love_ it if Miva had an "include" function.
>=20
> --=20
> Bill Guindon (aka aGorilla)
>=20
Leave a comment:
-
Guest repliedFile include in Miva?
> -----Original Message-----
> To: [email protected]
> Subject: [meu] File include in Miva?
> I understand that both MVCALL (OUI's %CALL%) and OUI's %INCLUDE% can load
umm, I'll be the first (perhaps the only) one to suggest that OUI and
MEU should not mix.
Best to send that to Merchant users, or Merchant coders. (I feel your
pain, but I'll not mention your name)
if it helps any, I would _love_ it if Miva had an "include" function.
--
Bill Guindon (aka aGorilla)
Leave a comment:
-
Guest repliedFile include in Miva?
You can use this syntax...
%OUI%%CALL(<A HREF ="http://www.yoursite.com/path/file.html|GET)%">http://www.yoursite.com/path/file.html|GET)%</A>
to pull a page from your site (or from anywhere on the web) directly into a
Merchant header or footer field. Note: Do NOT include the <html>, <head> or
<body> tags inside the static page. You can then use server side includes to
pull the same page into your other static pages.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Alex Brodsky
Sent: Wednesday, March 02, 2005 10:06 PM
To: [email protected]
Subject: [meu] File include in Miva?
Guys,
Is there a way to include an html file from the ~/html tree inside my
category header? I want to use the same HTML code snippet in both Miva and
static pages...
I understand that both MVCALL (OUI's %CALL%) and OUI's %INCLUDE% can load
html files but from the ~/mivadata tree.
I was thinking of using a Javascript function, but am not sure how the
Miva/OUI/VC's CPT processing will handle that.
Thanks,
Alex
Leave a comment:
-
File include in Miva?
Guys,
Is there a way to include an html file from the ~/html tree inside my
category header? I want to use the same HTML code snippet in both Miva and
static pages...
I understand that both MVCALL (OUI's %CALL%) and OUI's %INCLUDE% can load
html files but from the ~/mivadata tree.
I was thinking of using a Javascript function, but am not sure how the
Miva/OUI/VC's CPT processing will handle that.
Thanks,
Alex
Tags: None
Leave a comment: