HTML editor: libraries vs. snippets -...

User 2912214 Photo


Guest
6 posts

New user here...

I'm trying to determine whether Coffeecup (16.1) is appropriate for my simple, text-based (no fancy graphics needed) multi-page website.

Each page of my website is hand-coded HTML/CSS. I'm mostly happy doing that. But it has also involved copy/paste of common elements (e.g. page footer). And, of course, if I want to change and maintain such an element to take effect across all relevant pages, I have to change it manually in all the several tens of files.

So I'm looking for something that can help organise the pages. In particular, one feature would be the ability to have common code for those common elements (e.g. that page footer).

Coffeecup 16.1 seems to offer, down its left-hand edge, "Library" (and "Library items") and "Snippets". I have read through the various chapters about the HTML Editor Workspace But I don't see a description that says "a library does X, whereas a snippet does Y". Is there any such guidance somewhere, please? Something that describes good practice for their use (and when one is more appropriate than the other).

Thanks in advance.
User 122279 Photo


Senior Advisor
14,547 posts

Seen this: https://www.coffeecup.com/help/articles … ary-items/ ?

A snippet is a piece of code tnat can be inserted where needed, but if cbhanges are necessary, you have to change it for every oinstance of that said snippet.

A library item is also a bit of code that can be inserted several times on a website, but you update it in just one place.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2912214 Photo


Guest
6 posts

Many thanks for the link.

I had already seen it, but it doesn't seem to state "the library container is for this but, by contrast, the snippet container is for that".

So is the following description correct?
    The Snippet and Library containers are similar: both are for storing blocks of your HTML or CSS code that you can then use to build your pages.

    When you include a thing snip-item-X from the Snippet container, it is simply copied and that copy is, in effect, detached from the Snippet container. Subsequent updates to snippet snip-item-X will not be reflected in the copies already in pages: existing webpages remain unchanged and only new pages get the new version.

    By contrast, when you include lib-item-Y from the Library container, subsequent updates to lib-item-Y will be applied to existing web pages: both existing and new webpages get the new version.

Have I got that right?
User 122279 Photo


Senior Advisor
14,547 posts

Yes, that is right.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.