WeBuilder Code Preprocessor

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

WeBuilder Code Preprocessor

Post by NearZero »

Hi,

WeBuilder ver 9.1.0.98

Quick question regarding the use of the file code preprocessor.

So I'am using <!--%IncFile MASTER.EXT%--><---->.

Works great, I update master, open a file which has the preprocessor code, save it (change or no change) all good, but...

This can be time consuming for the follwoing reasons:
1) I cannot open a selected group of files from project manager or file explorer (normal method of shift click or ctl click, so one file at a time :()
2) Using file SAVE ALL does not work on files which have no changes.

Basically I have a master file, after I update it, I would like the changes reflected across all files which use the preprocessor code, without the time required to open each file and click save.
I guess this is a dynamic template for say a project.

Having an option to group select files, right click and select apply code preprocessor would be great.

Am I missing something, is there a better way, welcome the input :)
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: WeBuilder Code Preprocessor

Post by chrisjlocke »

You can open a group of files from the Tools | Load a list of files option. Yup, I know its a weird place, rather than the 'File' menu, but its more of a tool than a file thing... ;)
Can't help with the other problem - don't use that method of coding. I use php files that use 'include' files, so I guess that works differently.
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WeBuilder Code Preprocessor

Post by NearZero »

chrisjlocke, thanks for the reply, however using Tools | Load a list of files is only useful if you created the list file.

I can open a group of selected files using FILE | OPEN, but thought it odd that trying the same thing from the file explorer plane is not possible.

Cheers
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: WeBuilder Code Preprocessor

Post by syrupcore »

chrisjlocke wrote:You can open a group of files from the Tools | Load a list of files option. Yup, I know its a weird place, rather than the 'File' menu, but its more of a tool than a file thing... ;)
huh, yeah. that really should be in the file menu, shouldn't it?
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: WeBuilder Code Preprocessor

Post by chrisjlocke »

Never ever question the logic of a programmer. A coder at my old work used to make the menu options of a menu alphabetical so it was easy to find an option. Unfortunately, this meant the file menu for example read, "Exit", "Open", "Print", "Save", etc. Pure genius! ;)
snorkytheweasel
Posts: 21
Joined: Thu Nov 15, 2007 1:35 am

Re: WeBuilder Code Preprocessor

Post by snorkytheweasel »

If Microsoft had started the Windows interface with the menu options listed alphabetically, it would seem natural and intuitive to us all. Now most windows and linux gui programs use the MS conventions - for better or for worse - and we've all accepted the quirkiness therein. One suite of programs has bucked that trend with success: OpenOffice has a menu system that, while different from MS, makes sense. On those sad occasions when I have to use MS Office, I have a heckuva time finding menu options because the MS interface has some bizarre logic (or lack thereof).

One example: in MS Office, why on earth would "Page Setup" be listed under "File" instead of under "Format" ? OpenOffice has it right.

I still mourn the passing of WordPerfect, Lotus 1-2-3, and Quattro. Those programs all had interfaces designed for people who use computers.... and had some superior functionality that MS Office STILL doesn't have, after all these years.

Disclosure: over the years I have done contract work for Redmond, have been an MS Partner, have several MS certifications including the once-prestigious MCSE, used MS-DOS starting with 2.11, was a beta tester for DOS 5x through Windows 2000, sometimes still use MS products (reluctantly), and own MS stock. Other than my inherent self-destructive tendencies, I can't explain why I continue any of these activities. :D
This message is made from of 100% recycled non-GMO soy-based malarkey.
No electrons were harmed in its production or transmission.
- stw
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: WeBuilder Code Preprocessor

Post by Karlis »

The loading of list of files is a secondary helper tool and it has nothing to do with File menu. It is just an additional tool, so to keep File menu clean and allow faster access to more common commands this is in the Tools menu.

As for the question, indeed files are not updated if they have not been changed and you can not open all of your project files at once. Very few people need this, so there is no support for this to keep things tidy. It would be best to switch to PHP or some other scripting language if you have dynamic content that changes frequently. IncFile is just a little helper for small projects and separate cases.
Karlis Blumentals
Blumentals Software
www.blumentals.net
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WeBuilder Code Preprocessor

Post by NearZero »

Hi Karlis,

Thanks for the reply.

I guess what I would like to see is a tool like REPLACE IN FILES, only it parsed the <!--%incfile preprocessor.
Being that all the functionality is already present, just no batch option for processing.

I already use php extensively, but I have many instances where PHP and SSI (and alts) is not available.

It would also allow functionality like DWT's in dreamweaver. When one passes over a site I simply say, hey purchase WeBuilder, change this page run this command and your done.

Many customers I deal with have handhelds and tablets using static pages without any form of connectivity due to varying circumstances.

Anyway, keep up the great work, I can live without it, it's just a productive option and I am sure many dreamweaver and the like converts would miss some form of master pages.

Thanks again!
Steve
mwb1100
Posts: 72
Joined: Thu Jun 02, 2005 8:00 am

Re: WeBuilder Code Preprocessor

Post by mwb1100 »

Until Karlis acts on this request you may want to look at tools such as
  • ppwizard
  • m4
  • htmlpp
  • wpp
which are 'macro processors' that will let you do things similar to server side includes locally on your machine. It won't automatically happen when you save the files like WeBuilder's preprocessor stuff, but they'll give you pretty much all the power SSI has.
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WeBuilder Code Preprocessor

Post by NearZero »

Hi mwb1100,

Thanks for list, there's quite a few floating around.

Wrote my own, retaining WeBuilder syntax. Placed in TOOLS | External Programs, then added to Search Menu under REPLACE IN FILES entry as "Apply Templates".

Many thanks for the info though :)
Elygen
Posts: 49
Joined: Wed Oct 12, 2005 4:55 am

Re: WeBuilder Code Preprocessor

Post by Elygen »

O how many questions i now have. How do you add an item to the search menu. And when you say you wrote your own, what exactly did you write?
thanks
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WeBuilder Code Preprocessor

Post by NearZero »

Hi Elygen,

You can customize the toolbars and menus.

Right click a toolbar or the free space around the menu, and select CUSTOMISE. From the popup dialog, select commands, on the left side are the commands selecting one makes it's options appear on the right side, you can then drag the option onto a toolbar or menu location, nice feature.

Now if you goto OPTIONS | PREFERENCES on the menu, then select EXTERNAL TOOLS | EXTERNAL PROGRAMS you can add any program you like, once done these will appear under TOOLS | EXTERNAL PROGRAMS on the menu strip. Now f you use the above, you would find TOOLS on the left, then scroll on the right until you find EXTERNAL PROGRAMS, you then drag that item onto a menu or toolbar.

Finally I wrote my program in C# (.NET). It parses all files in the current directory (the %dir is passed when I added the external program), finds the code preprocessor <!--%incFile FILENAME.ext--> <!----> tag, and updates the content, two clicks and done. In case you are unaware of WeBuilders code preprocessor commands check in help, but basically the incFile directive inserts the named file into the current file at that point.

I'am currently adding more functionality, including TEMPLATE_START and TEMPLATE_END tags in the actual template file. This will allow extraction of only the content between the tags, meaning I can work on the template file with all the CSS etc making sure it looks good, then when I update the child pages only the content will be updated, we don't need the whole page.
This will give me a basic but very functional templating system.

Hope that all made sense.

Cheers
Steve
User avatar
Boofo
Posts: 69
Joined: Mon Sep 15, 2008 6:15 pm
Location: Des Moines, Iowa (USA)
Contact:

Re: WeBuilder Code Preprocessor

Post by Boofo »

NearZero wrote:Hi Elygen,

You can customize the toolbars and menus.

Right click a toolbar or the free space around the menu, and select CUSTOMISE. From the popup dialog, select commands, on the left side are the commands selecting one makes it's options appear on the right side, you can then drag the option onto a toolbar or menu location, nice feature.
I just discovered this myself. You're right, it is a great feature. Is there any way to take out menu items that you have added? I did a new menu and added some things to it and want to take one of them out and re-arrange the menu order. The only way I can see to do it is to delete the new menu and start over.
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WeBuilder Code Preprocessor

Post by NearZero »

Hey Boofo,

1) Reorder a current menu
Goto customize.
You can now click an item on the menu strip (eg search), you can drag any menu option to a new location within that menu.

2) To Delete an item from the menu
Same as above only drag the item onto the code window, gone.

3) If you are using EXTERNAL PROGRAMS [the submenu style] or (PROGRAMS) [the actual list of external programs]
You cannot delete individual items (that I am aware of) short of removing from your external program list :(.
However, you can reorder, in the external program list (OPTS|PREFS|EXT TOOLS|EXT PROGS) you will notice the UP DOWN arrows :)
Any change there will be reflected on the menu list where you added the them.

Its worth noting the last item in CUSTOMIZE | COMMANDS, it's new menu, handy for a quick set of frequently used items.

Sorry if I ranted or over stated the drill.

Cheers
Steve
User avatar
Boofo
Posts: 69
Joined: Mon Sep 15, 2008 6:15 pm
Location: Des Moines, Iowa (USA)
Contact:

Re: WeBuilder Code Preprocessor

Post by Boofo »

I'm sorry, I didn't explain it right. My bad. ;)

I made a new menu bar called Boofo. I added some items to that menu bar and I wanted to delete one of them off of there. I can keep it from showing though by unchecking it, but I can't remove it from the bar. I also wanted to re-arrange the items on the new menu bar but can't find a way to do it. I like having my own menu bar of frequently used items. ;)
Post Reply