Project templates

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;
Voltron
Posts: 6
Joined: Sun Jul 30, 2006 8:17 pm

Project templates

Post by Voltron »

Hello!

Can someone tell me how to use templates in projects? IĀ´m tying to duplicate the functionality in Dreamweaver and Frontpage whereby I can define a template page for a site( same navigation for example). When I edited the template, the change was not reflected in the files in the project defined. ANy ideas as to what IĀ´m doing wrong?

Thanks in advance!
Voltron
Posts: 6
Joined: Sun Jul 30, 2006 8:17 pm

Post by Voltron »

Any ideas? Tips?
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Post by chrisjlocke »

A template is very similar to a template in Microsoft Word - ie, its just a blank file, but when you open a template, it 'copies' it to a blank document.

Therefore, if you make any changes to the template, these changes will NOT be reflected in any documents based on that template, as they are all standalone files.

Core components (navigation, etc) can be added via 'include' files, if your server supports PHP or server-side includes. This way, if you do decide to change (for example) a navigation section, this WILL be reflected across all files that use that file.

Hope that makes sense.
Voltron
Posts: 6
Joined: Sun Jul 30, 2006 8:17 pm

Post by Voltron »

Thanks chrisjlocke for the reply, but you do not seem to understand what I mean. I have done server side templating with Python(CGI), REBOL(CGI), PHP, ASP and ASP.NET, thats not a problem, but sometimes there is a need to code several static pages based on a template that might change during development, this features speeds up development greatly, a reason why Dreamweaver, FrontPage or Fusion have implemented it. Webuilder, without this feature would be bothersome to use for large sites with a number of different static pages.

I would file this as a feature request, I hope it would be implemented.
Voltron
Posts: 6
Joined: Sun Jul 30, 2006 8:17 pm

Post by Voltron »

I added the feature request. Here is an explanation of what I meant.

What is a Template?

A template is a common structure of a web site that most of your web pages use. Usually web sites follow a standard structure, for e.g. you would have a header, a navigation bar and a footer that is common to all your pages. Imagine that your site has 25 pages. If you need to make one small change, let's say adding a new link, you would need to go to each of those 25 pages and change it manually. But using a template you only need to change it in the template and all the pages get updated automatically. Here you will learn how to use templates in Dreamweaver.
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

Currently you can use code preprocesssor, which is able to do the same thing what php does with includes, but locally whenever html file is saved and with no scripting at all...
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
PARoss
Posts: 43
Joined: Tue Aug 15, 2006 10:27 pm

Post by PARoss »

Is it possible to insert special comment tags into an html document (something like what Dreamweaver does). For instance:

<!-- begin -->
<p>content here</p>
< !--end-->

And then use the global search and replace feature to search for the beginning tag, then use a wildcard (*) to pick up variations in the content, and end the search string with the end comment; and then replace the wildcard with new content.

Does that make sense?

My first question is does HTML Pad allow for such searches now?

Phil
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

If the content is the same, then yes. It can be done vith regular expression search, you will just have to write a good/valid regular expression for search, because simple * wildcard will not do. Please let me know if you need help with regular expressions.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
PARoss
Posts: 43
Joined: Tue Aug 15, 2006 10:27 pm

Post by PARoss »

Karlis,

I'm not sure what you mean, because in my scenario the

<p>content here</p>

would not be the same from page to page. The scenario I have envisioned here is exactly like Dreamweaver's handling of templates.

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

Post by syrupcore »

I think the answer to the original questions is 'yes, you can certainly do templating in webuilder, rapid, htmlpad...' but 'no, not like dreamweaver'

Dreamweaver templates were made so end users couldn't break the site markup. Some developers realized you could use them for quick and dirty includes, which was smart but not their intended purpose. I don't wanna use propietary markup for my templating system.

There's no 'templating' function in webuilder but you can certainly use php includes and I'd certainly advise that you do. I run php on my machine so I dunno about the preprocessor karlis mentioned but downloading xammp and using php inlcudes is the only way to go!

The quick and dirty for those who might not to how to do it:

Using a menu include:
  • * Build your base page template with everything in it - header, menu, content, footer...
    * select the entire menu area and cut/paste it into a new document.
    * save the new document as 'menu.php'
    * In your original base page template, include this line where you menu once lived: <? include("menu.php"); ?>
    * Save it as template.php (or whatever but it MUST be .php)
    * load it up in yer browser and marvel and your geekiness.
    Note that this file must be saved in the 'webroot' of your local php server.
You can do these for anything that's repeated across your site, almost always used for headers and footers.

http://centricle.com/tools/html-entities/ to make that messy string of php code look correct. It's just an include with menu.php as the argument.


hope this babble helps someone.

Will
Voltron
Posts: 6
Joined: Sun Jul 30, 2006 8:17 pm

Post by Voltron »

Hi guys, it seems as if some still do not understand what I was asking for. A few posts ahead, I explained that its not about templating on a "live" site but on a "development" site with STATIC pages in the IDE!

Please take a look at Frontpage 2003, Dreamweaver or Golive. The formats of the templates are almost the same, and they work across themselves, i.e I have used GoLive templates in Frontpage without problems.

The template is very basic XML, with comments that the IDE recognizes as "disabled", these disabled code blocks, when enabled and edited, are replicated across all the pages that are marked in in project that use the template.

This is not about DYNAMIC page tempalting please!

I will post the format and an example of a tempalte soon.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

voltron, I understood exactly what you were asking for and tried to explain that you can not currently do that with webuilder. why would you want to when there are so many ways to do it with php/asp/cf/.net? you can run a local server that will be similar to your live server and build them that way. xammp is really really easy.

dreamweaver templates are for office administrators. ;)

Will


PS. man, that php include line got munched in my last post. I tried to be a good boy and write it with html entities. oh well. :)
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Post by chrisjlocke »

syrupcore wrote:PS. man, that php include line got munched in my last post. I tried to be a good boy and write it with html entities. oh well. :)
Fixed! ;) Stop being so clever, and just tick 'Disable HTML in this post' :lol:
Peper
Posts: 9
Joined: Wed Aug 10, 2005 9:31 pm

Post by Peper »

Karlis wrote:Currently you can use code preprocesssor, which is able to do the same thing what php does with includes, but locally whenever html file is saved and with no scripting at all...
I found code preprocesssor in the help, that is a very nice feature Karlis :) thanks.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

chrisjlocke wrote:
syrupcore wrote:PS. man, that php include line got munched in my last post. I tried to be a good boy and write it with html entities. oh well. :)
Fixed! ;) Stop being so clever, and just tick 'Disable HTML in this post' :lol:
hey! I never noticed you fixed that. Thanks!
Post Reply