SnippetMaster Support Forums
Return to main website
 
February 20, 2018, 05:47:52 AM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 20, 2018, 05:47:52 AM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  How To's & FAQs  |  Topic: Editing include files « previous next »
Pages: [1] Print
Author Topic: Editing include files  (Read 3651 times)
codebits

Posts: 2


[-] Editing include files
« on: April 10, 2009, 12:53:39 PM »

I have many websites built in PHP. These websites are modular in nature.

There is always a framework which loads other files or elements into it.
The framework maintains the HTML Head and Body structure elements.

Example:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>  </title>
<meta name="Author" content=" ">
<meta name="Keywords" content=" ">
<meta name="Description" content=" ">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="index,follow">
<?php include("inc/global.php"); ?>
<script type="text/javascript" src="flashfix.js"></script>
</head>

<body>
<div align="center">
  <div class="container">

<div class="header"></div>
<div class="topcap"></div>
<div class="bodyback">
<!-- start framework -->

<!-- start body -->

<div class="nav">
<?php include("inc/nav.php"); ?>
<div style="padding: 10px;"></div>

<div align="center">
<?php include("inc/mm.php"); ?>
</div>

<div class="con">
<?php include("inc/body.php"); ?>
</div>

<!-- end body -->

<!-- end framework -->

<div class="clr"></div>
</div>
<div class="footback"></div>

<div class="copy">
<?php include("inc/copyright.php"); ?>
</div>

</div>

</div>

</body>
</html>

My include files do not have the page structure elements and are loaded into the framework via PHP include calls.

When editing these include files they open in the editor with page structure elements and save with page structure elements.

How do I get around this issue ?

Example include file:
Code:
<h1 style="border-bottom:solid 1px #4A3826;">Sample</h1>

<DIV class="consub">
<p align="left">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>

<p align="left">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>

<p align="left">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
</div>

TIA
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 3169

SnippetMaster Author


WWW
[-] Re: Editing include files
« Reply #1 on: April 10, 2009, 01:01:40 PM »

Hello,

You should be able to edit the include files with no problem, since it's standard HTML code.

The "trick" is that you must wrap the editable content (everything inside the included file) with Snippet Tags, so that the editor knows you are editing only a snippet of HTML code and not the entire file.  Otherwise (if you to edit the "whole file" instead of a Snippet) the editor will automatically add the "missing" html/head/body tags, since the code it produces is xhtml compliant..

I hope that makes sense?

Here is a page on how to use the Snippet Tags:

http://www.snippetmaster.com/documentation/snippet-tags.html

Let me know if you get stuck with anything.  Smile
Report to moderator   Logged
codebits

Posts: 2


[-] Re: Editing include files
« Reply #2 on: April 10, 2009, 01:45:23 PM »

I see, and yes it makes sense

Thank You  Wink
Report to moderator   Logged
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  How To's & FAQs  |  Topic: Editing include files « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!