14, February 2012

Modifying Dreamweaver Template Class (PHP & Regex) - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Modifying Dreamweaver Template Class (PHP & Regex)
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Modifying Dreamweaver Template Class (PHP & Regex)  (Read 2025 times)
Just another rainy day
*
Posts: 1
10 credits
Members referred : 0


« on: Sep 02, 2009, 04:44:25 am »

Hi all, I'm loving this board, and this is my first post. I've been kicking around the idea of writing my own CMS, I know there are plenty pre-written projects out there but I want to tailor specifically for my needs. Anyways, I came across Chris Marshall's Dreamweaver Template Class that seems very promising: cmarshall.com/MySoftware/DreamweaverTemplate. I liked that I could access a Dreamweaver template via PHP and pull the template areas into a web form for editing. Dreamweaver template areas are blocks of code marked, beginning and end, by HTML comments.

Anyways, I?m having some success so far but there is one issue that I cannot seem to figure out.  Chris?s Dreamweaver Class will ?read? a Dreamweaver template file into a web form, but upon hitting submit doesn?t preserver the HTML comments that define the template areas. This can be seen even on Chris?s demo on his project page, do a view source on the empty template file that he provides.  In order to use this PHP Class as the engine of my CMS, I need to preserve the Dreamweaver template tags (HTML comments) so the page can be edited over and over again.

I've never been good at Regex and I've made the following change to line 86 of the project but for some reason I still cannot get the returning code to retain the HTML comments.

Original line:
Code:
<?php
$template_file 
preg_split '/<!-- .*?BeginEditable [^"]*"|<!-- .*?EndEditable -->/',  $template_file );
?>


My Change:
Code:
<?php
$template_file 
preg_split '/<!-- .*?BeginEditable [^"]*"|<!-- .*?EndEditable -->/',  $template_filePREG_SPLIT_DELIM_CAPTURE)
?>

When I test my new code, it seems to break on the closing part of the template area "<!-- InstanceEndEditable -->." Does anyone happen to what I might be doing wrong and have any suggestions? Thanks in advance and let me know if I can answer any other questions...

PL

edit: I had to remove the http from my link because I'm a new poster...
My name is Bong, James Bong
*
Posts: 10
64 credits
Members referred : 0


« Reply #1 on: Dec 12, 2009, 12:17:41 am »

you could try regexbuddy to check you regex strings....maybe it will lessen the hassle..just google regexbuddy..cheers
Google dot what?
*
Posts: 2
12 credits
Members referred : 0


« Reply #2 on: Oct 30, 2010, 07:56:34 am »

How about status?  Complete ?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=9088
Tags : php regex dreamweaver cms Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Modifying Dreamweaver Template Class (PHP & Regex)
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb 14, 2012, 10:23:36 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.