[Enhancement]Templates

320 views
Skip to first unread message

PaulD

unread,
May 18, 2011, 8:49:15 PM5/18/11
to bluegriffon
I don't do much web authoring, but recently, we asked me to update a
new web site for an organization, because the person that did it had
gone. Looking the HTML code, I have soon realized that there were
common pieces in each HTML pages, the menu at top of each page that
deploy when you hover over it. And some kind of main pages at the left
side. At firlst, I thought about factoring out these common pieces and
replace them with PHP includes. But I don't like much the idea of
having to replace HTML by PHP, just to include HTML files. Iframes
would seems not so unreasonable, but I somehow doubt about the fact
that the top menu will accept to show outside of the iframe when I
will hover over it. I finally learned that previous web author used
Dreamweaver, and that they do have templates, to handle common HTML
code for many pages.

Now, for me, a template is basically just an HTML file that I include
in an other.
Problably between:
<-- BEGIN Inluded file: somefile.html -->
<-- END Included file: somefile.html -->

Guess it would be cool to have a + sign, that let you show or hide the
included file.

Should the editor allows you to edit this region?
In a very simple solution no.

In a more sophisticated yes.
But then you should have an option (button?) to recopy original file,
loosing changes...
Maybe later to recopy original file but keeping changes (using a
diff ).
Or even one day, to patch the included file with the changes in this
local file.

Daniel Glazman

unread,
May 19, 2011, 2:35:16 AM5/19/11
to blueg...@googlegroups.com
Le 19/05/11 02:49, PaulD a �crit :

> I don't do much web authoring, but recently, we asked me to update a
> new web site for an organization, because the person that did it had
> gone. Looking the HTML code, I have soon realized that there were
> common pieces in each HTML pages, the menu at top of each page that
> deploy when you hover over it. And some kind of main pages at the left
> side. At firlst, I thought about factoring out these common pieces and
> replace them with PHP includes. But I don't like much the idea of
> having to replace HTML by PHP, just to include HTML files. Iframes
> would seems not so unreasonable, but I somehow doubt about the fact
> that the top menu will accept to show outside of the iframe when I
> will hover over it. I finally learned that previous web author used
> Dreamweaver, and that they do have templates, to handle common HTML
> code for many pages.
>
> Now, for me, a template is basically just an HTML file that I include
> in an other.
> Problably between:
> <-- BEGIN Inluded file: somefile.html -->
> <-- END Included file: somefile.html -->

That's doable. But please note that somefile.html is NOT an HTML
file but the serialization of a HTML fragment only. It's not a
full document...

Let me think about it. I may add that feature to v1.1 or the next
one.

> Guess it would be cool to have a + sign, that let you show or hide the
> included file.
>
> Should the editor allows you to edit this region?
> In a very simple solution no.

Hmmmm... Again, that's doable in the Wysiwyg view. Not easy at all
but doable. In the source view though, that's much harder and I have
no idea if Ace (the source editor BlueGriffon uses) will let "mark"
a section of the document as read-only. I have to investigate.

</Daniel>

PaulD

unread,
May 19, 2011, 9:02:01 AM5/19/11
to bluegriffon
You are right that .html should be used for complete html files.
I have search some options, and come with:
-the obvious .inc for include file
-.pht for partial hypertext file
-.htx for Extended hypertext template (MS FrontPage Database Results
(HTML-like query script.))

Anyway... I wrote that message after reading about templates in Amaya.
And I was a bit frustrated because I was not really understanding what
I was reading.
It did looks too complex:
http://www.w3.org/Amaya/User/doc/Templates.html
In french: http://dev.w3.org/Amaya/doc/WX/Templates.html.fr

But now, after reading it about 10 times, it begin to make much
sense. ;-)
It would probably have been much easier with a few examples.

What I was proposing is really the cowboy way of doing things, of a
programmer.

But I should not forget that I came to BlueGriffin because I was
searching an HTML editor that people not knowing at all the HTML and
CSS specifications could use to edit their web site... not so much for
myself that think that editing HTML and CSS files inside a text editor
while reading HTML and CSS specifications aside is normal.

So, I begin to like the more rigourous Amaya XML template. Yes, that
is XML only.
It is more like I the 'expert' write a base document, and specify how
the normal user, will be allowed to 'freely' extend that document by
filling the blanks I have set, and the suggestions I have done for
him. I guess both me and the user are more happy to know they will not
break too much things. And the user know he can ignore fixed parts of
the model, and just add what he wants... in the blanks.

But sure, I would prefer to have access to these templates inside
Bluegriffon than in Amaya!

drscheme123

unread,
May 19, 2011, 9:04:28 AM5/19/11
to blueg...@googlegroups.com
How difficult would it be to add templates as used in dreamweaver without includes but uneditable-regions and html-file-update on template-change?
That's the only feature my father needs to fully step away from dreamwevaer towards bluegriffon.

Cheers,
Andre

:wq ;-)


2011/5/19 Daniel Glazman <daniel....@gmail.com>
Le 19/05/11 02:49, PaulD a écrit :

Daniel Glazman

unread,
May 19, 2011, 9:19:02 AM5/19/11
to blueg...@googlegroups.com
Le 19/05/11 15:04, drscheme123 a écrit :

> How difficult would it be to add templates as used in dreamweaver
> without includes but uneditable-regions and html-file-update on
> template-change?
> That's the only feature my father needs to fully step away from
> dreamwevaer towards bluegriffon.

Doable but difficult. I have a blog post about it.
Please read http://is.gd/xJxsAR

</Daniel>

drscheme123

unread,
May 19, 2011, 9:25:02 AM5/19/11
to blueg...@googlegroups.com
How can we help?

:wq ;-)


2011/5/19 Daniel Glazman <daniel....@gmail.com>
Le 19/05/11 15:04, drscheme123 a écrit :

Daniel Glazman

unread,
May 19, 2011, 9:46:31 AM5/19/11
to blueg...@googlegroups.com
Le 19/05/11 15:25, drscheme123 a écrit :

> How can we help?

Easy: buy my add-ons. And I'll hire more people to work
on BlueGriffon. I'm not kidding.

</Daniel>

PaulD

unread,
May 19, 2011, 10:15:31 AM5/19/11
to bluegriffon
I am thinking about how I would make templates.
And at first, I would come with a template file containing all the
instances.
Here is my example:

Following would be template.[someextension]
<html>
<header>
<instancehead name="one" filename="one.html" />
<instancehead name="two" filename="two.html" />
</header>
<body>
<p>
<instance name="one">Hi everybody!</instance>
<instance name="two">This is a template test!</instance>
</p>
</body>
</html>

To be generated file one.html
<!-- This file was generated by temlate named template.[someextension]
-->
<html>
<header>
<body>
<p>Hi everybody!
</p>
</body>
</html>

Well, that's basically means making the full web site inside a single
template file.
But then, it is easy to regenerate, change or share the website html
files.

PaulD

unread,
May 19, 2011, 11:18:28 AM5/19/11
to bluegriffon
Thinking more about it... instancehead element inside header element
is bad because you loose the ability to have different header for the
different instances.

So I would make it:
<html>
<instances>
<instance id="one" filename="one.html" />
<instance id="two" filename="two.html" />
</instances>
<header>
<instance id="one">
<title>Hi!</title>
</instance>
<instance id="two">
<title>Template test</title>
</instance>
</header>
<body>
<p>
<instance id="one">Hi everybody!</instance>
<instance id="two">This is a template test!</instance>
</p>
</body>
</html>

I like to think about how a web server could bypass the .html files
and only used these templates files.
How a web server could send the compressed template file to the web
browser, and have the browser only request the media files.
How the anchors, could reference an instance rather than directly a
filename.
But guess I am thinking too much, and that there is something very
wrong I failed to see... there is always something wrong that I don't
see when I have what seems good ideas like that. ;-)

PaulD

unread,
May 19, 2011, 11:56:33 AM5/19/11
to bluegriffon
That was still quite wrong... once again, last time for some hours:

<html>
<instancesheader>
<instance id="one" filename="one.html" />
<instance id="two" filename="two.html" class="tests" />
<instance id="three" filename="three.html" class="tests" />
</instancesheader>
<header>
<title instances="#one">Hi!</title>
<title instances="#two">Template test</title>
</header>
<body>
<p instances="#one">I will show only in instance one</p>
<p instances=".tests">This is a template test that will show in
instance two and in instance three.</p>
<p instances=".tests" instanceexception: #three> I will show in
instance two but not in instance three</p>
</body>
</html>

Quite a bit better I think.

Daniel Glazman

unread,
May 19, 2011, 11:59:37 AM5/19/11
to blueg...@googlegroups.com
Le 19/05/11 17:56, PaulD a �crit :

This is not html. I can't go beyond the html spec, sorry.

</Daniel>

drscheme123

unread,
May 20, 2011, 12:25:59 PM5/20/11
to blueg...@googlegroups.com
that's not really the open-source-community-fashion...
if you don't like volunteers - that's your decision...

:wq ;-)


2011/5/19 Daniel Glazman <daniel....@gmail.com>
Le 19/05/11 15:25, drscheme123 a écrit :

Daniel Glazman

unread,
May 20, 2011, 12:39:43 PM5/20/11
to blueg...@googlegroups.com
Le 20/05/11 18:25, drscheme123 a écrit :

> that's not really the open-source-community-fashion...
> if you don't like volunteers - that's your decision...

"Open source" never implied "starve to death". I am keeping
the editor open source and free because I sell add-ons. This
is not an extra activity for me, I spend 200% of my time on
BlueGriffon. No other option (service, pro version) is feasible
on such a product.

</Daniel>

drscheme123

unread,
May 20, 2011, 7:10:52 PM5/20/11
to blueg...@googlegroups.com
I never said anything about starving...
I asked how we, the user-community of bluegriffon could help and your decision is not to cooperate with volunteers to improve bluegriffon other than recieving translations.
As i said: your decision...

I just wanted to help with my spare time.
But that is obviously of no value for you.

Well, that's a pitty...

And no, i won't get into licensing now and how to make money with opensource...
Your AddOns aren't and i simply don't need them...

Donation to support a project is something completely different and there are tons of ways one can support opensource.
I tried to support bluegriffon, but you refused to accept that help...

Cheers,
André

:wq ;-)


2011/5/20 Daniel Glazman <daniel....@gmail.com>

Daniel Glazman

unread,
May 21, 2011, 3:03:33 AM5/21/11
to blueg...@googlegroups.com
Le 21/05/11 01:10, drscheme123 a écrit :

> I never said anything about starving...
> I asked how we, the user-community of bluegriffon could help and your
> decision is not to cooperate with volunteers to improve bluegriffon
> other than recieving translations.
> As i said: your decision...

I never said that. And I got multiple code contributions for 1.0.

> I just wanted to help with my spare time.
> But that is obviously of no value for you.

Start with fixing minor defects you find using the app?

> Donation to support a project is something completely different and
> there are tons of ways one can support opensource.
> I tried to support bluegriffon, but you refused to accept that help...

Ask KompoZer's maintainer how much he got from donations in 5 years.
Probably around 3000€
Nobody can live and maintain software for 5 years on that.

</Daniel>

PaulD

unread,
May 21, 2011, 4:43:42 AM5/21/11
to bluegriffon
> This is not html. I can't go beyond the html spec, sorry.
Do you realize that I was expecting BlueGriffon to internally use an
extended HTML file containing all the web pages, but that the
generated HTML files would be fully HTML compliant?

Is it the Gecko engine that does not allow to manipulate extended html
elements and attributes?

Daniel Glazman

unread,
May 21, 2011, 4:50:14 AM5/21/11
to blueg...@googlegroups.com
Le 21/05/11 10:43, PaulD a �crit :

No. You can certainly define your own elements in xhtml/html5 and
use your own namespace for that. But I prefer relying on non-intrusive
XML comments <!-- ... --> that on new elements; that way, the HTML
validator will not complain.

</Daniel>

Reply all
Reply to author
Forward
0 new messages