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

[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.

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

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.

Last edited by billynoah on Sat Aug 30, 2014 12:06 am, edited 2 times in total.

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

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

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.

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.

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

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.

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.

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

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.