Page 1 of 3

vQmod 2.X development and feature request discussion thread

Posted: Thu Jan 10, 2013 10:50 pm
by JAY6390
This thread is intended to allow people to easily request features they would like to see in the vQmod system, discussion on ideas/current features. Bugs are to be reported on the official google code site here. It is not intended as a thread for general consumer issues with third party vQmod xml files. Those need to be supported by the developer of the vQmod xml itself. Two features we've been asked for before and rejected are

Code: Select all

- SQL support to run queries
- New file creation
Both of these requests have been rejected so please don't reiterate them

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Nov 09, 2013 7:12 am
by sputnik-1
[FEATURES]
Could we have a $DEBUG variable that could be set to TRUE, and that puts vQmod into debugging mode please?

When in DEBUG mode vQmod could write a lot more to the log file such as the filename, line number and line of text where a <search> modification pattern has been found. On the next line of the log file vQmod could then write the same line with the <add> modification that vQmod has made to that line. This could be used on a development server for testing vQmod xml scripts, to compare the original line of text with the modified line of text, to make sure the
xml scripts are doing exactly what the developer wants them to. Once the developer is happy the xml script is performing as intended, the script can then be uploaded to the live server.

Another thing I'd like to see in vQmod is the ability to use :

<!-- ===== this is an xml comment on one line ===== -->

xml single line comment syntax.

This would make it possible to put comments anywhere in the vQmod xml scripts as needed.

Re: vQmod 2.X development and feature request discussion thr

Posted: Wed Aug 20, 2014 7:26 am
by JAY6390
Got a 2.5.0 beta release that would like a few people to test, so if you're interested please get in touch. New features/bug fixes are
- Better performance by caching files checked already
- Show error details for invalid XML files not just they can't be loaded (ie the line number and character)
- Lock vqcache files when writing to them
- Negative offset for replace method removes lines before matched line
- Error handling of missing <search> or <add> tags in an <operation>
- Fixed (I hope) the installer of a weird bug (https://code.google.com/p/vqmod/issues/detail?id=145)
- Cleaned up some basic formatting

Jay

Re: vQmod 2.X development and feature request discussion thr

Posted: Wed Aug 20, 2014 9:16 am
by billynoah
JAY6390 wrote:- Negative offset for replace method removes lines before matched line
You rock!

Having worked with vQmod extensively over the last year since posting in that thread I find I hardly ever use replace anymore, but this feature is greatly appreciated all the same.

Re: vQmod 2.X development and feature request discussion thr

Posted: Thu Aug 21, 2014 9:19 am
by JAY6390
Updated beta now available that will work with OpenCart 2.0. Anyone that wants a copy, get in touch via PM

Re: vQmod 2.X development and feature request discussion thr

Posted: Fri Aug 29, 2014 11:46 pm
by billynoah
Hey Jay,

Just a wild thought for a future version that I know may not be realistic but here goes...

What about implementing a jQuery style CSS search position to match elements in tpl files? something like:

<search css="true" position="prepend"><![CDATA["#tab-shipping .form"]]></search>

I think it's pretty self explanatory - finds the element(s) with class "form" inside #tab-shipping and prepends in this case.

Additional position options could be "prepend" and "append" just as they are used in jQuery. "before" and "after" and the rest would still be useful but prepend and append would be key here.

Probably don't need to explain but the idea here is that sometimes you want to match a single or multiple elements inside another with only a certain id or class name.

How hard would this be? I know you are already parsing the xml in the vqmod itself so could this functino be extended to the modified files as well? I often find myself using "index" for things like this (when I need to add something after the third form element for example) but as you know the index can change if other vqmods are involved. A CSS search would be really awesome for modifying tpl files.

Please let me know your thoughts.

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 12:06 am
by JAY6390
vQmod 2.5.0 has now been released. For now, it's only available to download from
http://forum.opencart.com/viewtopic.php ... 45#p513645
while we sort out alternate download locations

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 12:28 am
by JAY6390
billynoah wrote:Hey Jay,

Just a wild thought for a future version that I know may not be realistic but here goes...

What about implementing a jQuery style CSS search position to match elements in tpl files? something like:

<search css="true" position="prepend"><![CDATA["#tab-shipping .form"]]></search>

I think it's pretty self explanatory - finds the element(s) with class "form" inside #tab-shipping and prepends in this case.

Additional position options could be "prepend" and "append" just as they are used in jQuery. "before" and "after" and the rest would still be useful but prepend and append would be key here.

Probably don't need to explain but the idea here is that sometimes you want to match a single or multiple elements inside another with only a certain id or class name.

How hard would this be? I know you are already parsing the xml in the vqmod itself so could this functino be extended to the modified files as well? I often find myself using "index" for things like this (when I need to add something after the third form element for example) but as you know the index can change if other vqmods are involved. A CSS search would be really awesome for modifying tpl files.

Please let me know your thoughts.
Hi Billy something like that would be great, but isn't practical unfortunately. It's a similar idea to the dom traversal suggestion from a fair while back and the main pitfall would be any php intertwined with the html

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 12:46 am
by billynoah
Sorry if this has been discussed.. would you mind explaining (or sharing link to explanation) about how the php would be a pitfall? Are there any potential workarounds for this?

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 1:03 am
by JAY6390
billynoah wrote:Sorry if this has been discussed.. would you mind explaining (or sharing link to explanation) about how the php would be a pitfall? Are there any potential workarounds for this?
Sure - I think I actually deleted the old discussion on it, but basically with having php able to echo content, it can go pretty much anywhere and since php isn't parsed by vQmod, it means it can cause a lot of headaches

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 1:08 am
by JNeuhoff
billynoah wrote:Sorry if this has been discussed.. would you mind explaining (or sharing link to explanation) about how the php would be a pitfall? Are there any potential workarounds for this?
There are various PHP XML and DOM parsers. However, VQMod doesn't even parse the source file to be modified, it just reads it in as an array of lines.

If we were to modify the HTML output using some kind of a PHP DOM Parser, this would have nothing to do with VQmod. It would be a quite different approach, for which there'd be better places to integrate this, such as allowing a preRender or postRender method in the controller which could deal with this. An XML parser would be even better, unfortunately OpenCart doesn't use XHTML5, rather, it uses HTML5. Either way, the parser would only be able to parse the HTML elements, not any embedded PHP-sections nor Javascript sections. We'd have to find workarounds for this problem.

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 1:15 am
by billynoah
I see. Yeah the idea for this would basically only apply to HTML elements. I've had a look at the functions and understand about how it reads the files as an array. And yes this would really be quite a different approach.

If it could be integrated with the current system successfully I think it would make vQmod quite robust and I'm sure you would agree. But I can also see why the obstacles might be a bit discouraging and counter to the current direction of this project.

Thanks for taking time to explain.

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Aug 30, 2014 1:31 am
by JAY6390
As JNeuhoff's already said, vQmod works in a place where it's just not going to be ideal. vQmod runs on the file loads, where as the best place to do what you want would be in the rendering methods in the response library class. You could probably design another system to do this, which could work completely separate. This could be done using either a vqmod hook, ocmod hook or override engine class to catch the html before it's output. Of course, you could simply use JavaScript to do what you want

Re: vQmod 2.X development and feature request discussion thr

Posted: Wed Sep 03, 2014 3:50 am
by rph
billynoah wrote:Just a wild thought for a future version that I know may not be realistic but here goes...

What about implementing a jQuery style CSS search position to match elements in tpl files?
I started a similar topic at http://forum.opencart.com/viewtopic.php ... 9&p=478386 . Being able to edit output on the DOM level would be extremely powerful feature for OpenCart. The big problem is OpenCart uses javascript with embedded HTML which throws DOMDocument for a loop. The only parser I've found that can handle it is HTML5-PHP but it's very slow.

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 06, 2014 12:24 am
by robster
Sorry if this has been covered already but I have just downloaded latest VQmod version 2.5.0 and it would not let me install it (and I have done this hundreds of times on previous versions). I just get 404 no access.

I replaced it with 2.4.1 and it installed straight away.

What do you think could be causing that?

Rob

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 06, 2014 12:34 am
by JAY6390
Hi Rob

Can you provide me ftp details so I can take a look as to why your server isn't working with it. I've tested this on a number of flavours of linux, windows and on OSX without issue. The latest version was given a change with the .htaccess files to make them (supposedly) more reliable to prevent access where there shouldn't be any such as people trying to download your mods.cache or log files. If you want to e-mail me at jay@jaygilford.com I can take a look for you

Cheers
Jay

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 06, 2014 12:48 am
by robster
Hi Jay

Done

Rob

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 20, 2014 1:23 am
by billynoah
2.5 won't install for me. Just keep getting "client denied by host configuration" in error log. 2.4 works fine. Presumably this is something to do with changes you made to the .htaccess and I don't have time at the moment to dig into it but just thought you should know.

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 20, 2014 5:29 am
by rph

Re: vQmod 2.X development and feature request discussion thr

Posted: Sat Sep 20, 2014 8:53 am
by billynoah