• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Page Template like Dreamweaver???

New Here ,
Jul 16, 2009 Jul 16, 2009

Copy link to clipboard

Copied

(New to eclipse switching over from Dreamweaver)

I am building a project that requires some "core" code in every file. With Dreamweaver I was able to save a file as a template and call it everytime I needed to create a new page.  Is there a way to do that in CF Builder?

TOPICS
Builder

Views

2.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 16, 2009 Jul 16, 2009

Copy link to clipboard

Copied

I think you can create your code as "snippets" and then after creating a blank page, pull the "snippet" into it. It looks like the Eclipse engine requires this extra step.

As a side note, if you are building a project that requires some "core" code in every file, could I suggest you look at http://www.fusebox.org which is an easy to learn, very very accessible, framework for coding ColdFusion (and other languages), and I've found personally very helpful over the years in moving from "core code in every file" to a manageable, flexible, and fun approach to coding.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 16, 2009 Jul 16, 2009

Copy link to clipboard

Copied

You can set the initial CFM/CFC content for new pages in Preferences->ColdFusion->Editor Profiles->Editor. Check 'New File Settings' section.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 05, 2009 Aug 05, 2009

Copy link to clipboard

Copied

The options discussed here will definitely work assuming you don't need to make too many sitewide updates to the boilerplate code. For example, if you decide to change some code in your boilerplate, then any files created previously created are now out of sync. Personally, I've gotten around this by relying on custom tags.

http://www.coldfusioncookbook.com/entry/142/How-can-I-easily-control-the-look-and-feel-of-my-site?

I know in Dreamweaver, if you create a template and you update the template, Dreamweaver gives the option to push the changes to all child pages when the template is modified. It's highly doubtful you will get such a feature in Eclipse, at least not without an extra plug-in of some sort

You could, in theory, do mass Find/Replace across the site using CF Builder. I remember being able to do this using Eclipse/CFEclipse with results almost as good as Dreamweaver's mass replace engine. I can't figure out how to do it in CF Builder though. Best I could do was go to Search->Search and then click on "Replace", but I'm not really sure what that does. If you could get this to work, this approach may be a viable workaround for such a scenario.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 06, 2009 Aug 06, 2009

Copy link to clipboard

Copied

You should only ever use DW templates if you're maintaining a static HTML site: DW templates are a work-around for the fact that HTML doesn't have a concept of factoring oft-used code out into separate files.

In a CF-driven site, you should have the code in a separate CFML file, and then include that file from any other template that needs to call that code.  You should not be using DW templates to fudge this.

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2015 Jun 22, 2015

Copy link to clipboard

Copied

I have also extensively used Dreamweaver templates in my projects. Now that DWCC no longer supports ColdFusion development, I am looking for an alternative. Was wondering if CF Builder supports DW Templates. Apparently not. My point of view is that using DW templates is not fudging. It is a very useful way of building a project.

Breaking up a format into a lot of different CF files seems real kludgey to me. I've seen it done and inserting code into editable areas with the DW templates seem far more maintainable.

Any news on what you ended up doing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 29, 2015 Jun 29, 2015

Copy link to clipboard

Copied

LATEST

David,

What you refer to as "kludgey" would probably be referred to as proper "MVC" application design. As applications grow over time, MVC makes maintenance and improvements much more streamlined.

At the very least, you should consider putting "boilerplate" code into a separate CFM file and using <cfinclude> to load that code into any page where it is needed. Putting the same exact code into multiple files is a "code smell".

-Carl V.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation