Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

Convert html to story

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


George.Harrison at gov

May 22, 2009, 9:43 AM

Post #1 of 4 (996 views)
Permalink
Convert html to story

Does anyone know of a script or template that will construct a story
given a story element and a block of html text?


phillip at communitybandwidth

May 22, 2009, 9:54 AM

Post #2 of 4 (920 views)
Permalink
Re: Convert html to story [In reply to]

On 22-May-09, at 1:43 PM, Harrison, George (STEM) wrote:

> Does anyone know of a script or template that will construct a story
> given a story element and a block of html text?



Use case?

--
Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
www.communitybandwidth.ca // www.phillipadsmith.com


chris.schults at pccsea

May 22, 2009, 10:02 AM

Post #3 of 4 (922 views)
Permalink
RE: Convert html to story [In reply to]

> Does anyone know of a script or template that will construct a story
> given a story element and a block of html text?

George,

FYI: When migrating the PCC website to Bricolage, I wrote a bunch of PHP
scripts that converted flat HTML files to Bricolage XML that I then
imported using bric_soap. I created a separate script for each story
type as each had its own collection of elements.

I used PHP Simple HTML Dom Parser
<http://simplehtmldom.sourceforge.net/>, PHP Tidy
<http://www.php.net/tidy> and a bunch of custom search and replaces.

My method was to:

1) Scan a directory for target files (fortunately a consistent file
naming convention was used that made mapping files to story types easy)
2) For each file, perform some cleanup by either removing code or
replacing tags
3) Use Tidy to perform further cleanup
4) Use PHP Simple HTML Dom Parser to iterate through all the tags and
convert to Bricolage XML
5) Import using bric_soap

This, of course, was all very specific to PCC.

Chris

--------------------------------

Chris Schults
Web Developer
PCC Natural Markets
206-547-1222 x104
chris.schults [at] pccsea
http://www.pccnaturalmarkets.com

Sign up for PCC Fresh, a monthly newsletter filled with seasonal
recipes, exciting new products, and more:
http://www.pccnaturalmarkets.com/enews


George.Harrison at gov

May 22, 2009, 10:09 AM

Post #4 of 4 (929 views)
Permalink
RE: Convert html to story [In reply to]

On May 22, 2009 11:54 AM: Phillip Smith wrote

> On 22-May-09, at 1:43 PM, Harrison, George (STEM) wrote:
>
>> Does anyone know of a script or template that will construct a story
>> given a story element and a block of html text?
>
>
>
> Use case?

OOH, I hate that question, forces me to think about what I'm doing.


How about, migrate an existing html page (valid html (4.01 Transitional
or xhtml 1.0 Transitional) from hand maintained to bricolage maintained.
All presentation would already controlled by stylesheets. Body only
would be converted, head html would be controlled by templates.

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.