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

Using Dreamweaver to edit *partial* web page (chunks of HTML code)?

New Here ,
Jan 25, 2010 Jan 25, 2010

Copy link to clipboard

Copied

Hello,

I am using a custom PHP framework to build a website.


This framework is quite simple, it relies on 2 types of files:

  1. Templates: site-wide PHP/HTML files including all the logic, HTML header (links to CSS & JS files), Company logo HTML menus & related navigation code, searchbox, footer etc. Only 2 templates exist: one for the homepage, another one for all the other pages.
  2. "content files": these files contain mostly static HTML code. Content files are imported by the PHP template using PHP's include() function.

As content files are inserted within a global HTML page, these only  contain chunks of HTML code: no tags such as "head" "body".

On the attached PNG, the green part is the code from the template, the red part is the code from the "content file".

A typical template file would be:

          <html>


            <head>

              (load CSS files, JS files...)

            </head>

 

            <body>

              (HTML headers & menus)

              <?php include($content_file); ?> <!-- Includes partial HTML file with page content -->

              (HTML footer)

            </body>


          </html>

A typical content file would be:

          <h1>TITLE</h1>


          <h2>subtitle</h2>

          <p>Lorem ipsum<img src=""  class="myimg" /></p>


          <h2>subitle</h2>

          <p>Lorem  ipsum</p>

Templates are NOT editable by users.

Content files are editable by users, using Dreamweaver.

The problem is, users cannot edit those content files since it is not a valid HTML page. The CSS required to enforce the styles are not loaded since HTML headers are not present. It looks ugly and Dreamweaver tries to insert standard HTML tags such as <html>, <body> and so on.

I see 2 hypothesis, but I cannot find an answer in the Dreamweaver documentation:

  1. have DW edit the content files alone, in which cas we would need to tell DW that it is editing a partial web page and not a full one
  2. have DW edit the content file while applying the PHP template, in which case we would need to tell DW that is should discard most of the code and save only the "content file"

Hypothesis 1: Standalone edit of content files. Is there a way to tell Dreamweaver

  1. that it is editing a partial HTML file,
  2. that it needs to load additional CSS stylesheet to display the styles
  3. that it should not insert standard HTML body and headers tags, that we know the page is not standard compliant as-is
  4. that creating additional style is forbidden, it is only allowed to use styles defined in the stylsheet

Hypothesis 2: Edit of content files within the template. is there a way to tell Dreamweaver

  1. that it is should add HTML code from the template before and after the loaded "content file"
  2. that when saving the "content file" it should discard all HTML/PHP code from the template, saving only the content itself
  3. that creating additional style is forbidden, it is only allowed to use  styles defined in the stylsheet

I cannot believe noone has been faced with this problem before, the fact is I cannot find any answer about this issue.

Best Regards,

M

TOPICS
Server side applications

Views

2.2K
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 ,
Jan 25, 2010 Jan 25, 2010

Copy link to clipboard

Copied

LATEST

I have moved this thread to the Dreamweaver Application Development forum, which deals with PHP and similar issues.

Several things spring to mind.

  1. Do your template files have a standard .html file name extension? If so, you could add .html to the file types that Dreamweaver does not automatically rewrite. Select Code Rewriting in the Preferences panel, and add .html to the list of files in "Never rewrite code".
  2. If your template files use a file name extension not recognized by DW, add them to the list using the instructions in http://go.adobe.com/kb/ts_tn_16410_en-us. You might also need to add them to the list of files that DW doesn't rewrite.
  3. To get access to styles in pages that are composed of fragments, use Design Time Style Sheets. See http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WScbb6b82af5544594822510a94ae8d65-7e17a.html.

Votes

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