logo

The Start of Tips Week: Giving your design more structure

As promised, I am going to try and pass on a tip for each day of this week. Starting today with a way to help keep database resources in order.

In conventional web design, where you use many different files, folders are used to organise and structure things like images. For example, you might have a folder called images that contains subfolders called things like "icons", "buttons" and "photos". If you add images as Image Resources to a Domino database you lose this structure and it can become a real mess. Well, there's a nice and simple way to add structure. All you have to do is add the image and then rename it. As below, where I've added an image called folder.gif and renamed it "images/icons/folder.gif":

Designer Screenshot

This helps keep all the images ordered in a logical manner and makes them easier to find. To use them in your HTML you simply add this pseudo-folder-name to that of the image. E.g:

<img src="images/icons/folder.gif" />

Note that we are missing the database name from the URL. That's because I always use this time-saving method.


You're not restricted to Image Resources! You can do this to just about all the areas of a Domino DB's design where you deal with "files"; CSS Resources, JavaScript Libraries and other files for example. All in all, it makes for a much more organised working environment.

Comments

    • avatar
    • mt69clp
    • Wed 1 Dec 2004 06:54

    I do like Lotus Notes because you can almost always create a workaround to mimic a funtionality which is not implemented.

    I really hate Lotus Notes because you always have to mimic functions which everybody misses in Notes.

    P.S. A question to the native english readers: Is it correct to say 'I do like' to stress the meaning of the sentence or should I just say 'I like...' ???

    • avatar
    • tq
    • Wed 1 Dec 2004 07:00

    Jake - glad you had a good trip. And this is a great tip - simple but so effective.

    • avatar
    • Jake
    • Wed 1 Dec 2004 07:03

    Thanks tq.

    mt. Both "I like" and "I do like" work ok. The "do" is probably not needed but, when it's there, tends to add some more weight to it. Almost like it would be in italics and would be read with some emphasis on the "do".

    • avatar
    • laurens
    • Wed 1 Dec 2004 07:08

    Great tip. Just another method that could also work:

    What I usually do is create a Page called "img" where I place all my image files upon. On this Page, I may create some tables or paragraph headers to which I attach the image files. The urls to files on this page are simple to remember:

    <img src="img/$file/folder.gif" />

    Click the link to check out such a Page where the page is also used for non image files.

    {Link}

    Advantage: simple in Notes and simple in Webbrowser.

  1. I do something similar with JavaScript and CSS pages. If I have a JavaScript page called global.js, I name it js.global and give it an alias of global.js. Likewise, project.css would get stored as css.project|project.css That way, all of my JavaScript pages and all of my Stylesheets are grouped together in the designer but the normal html calls to import these pages still work.

    • avatar
    • Jake
    • Wed 1 Dec 2004 07:23

    That's exactly what I used to do Steve. Doesn't seem right somehow though. Makes much more sense to call the pages names like "stylesheets/project.css" which has the same effect and looks more design-like.

  2. Ok heres a little trick I was saving up for myself and my template.

    View names can have a / character in them as well. So you could create a view called e.g.

    blog/archives

    for your documents.

    Now referencing the documents in the view can be achieved by categorising the first column of the view with the UNIQUE name of the document. e.g.

    blog0001.html

    So the URL becomes

    {Link}

    Now you can have a folder structure for your Domino web documents. No more view or document UNIDs and a nice structural URL to boot.

    It seems to work although I have only tested on R5.

    regards john marshall

  3. Before everyone chips in. The technique does not work if you wish to edit the document with ?OpenForm. I use a pure HTML method for editing forms not a notes form so this is not limitation for myself.

    regards john marshall

  4. They say that "great minds think alike"... (and I'm being presumptious calling myself a "great mind"), but this is damned scary:

    {Link}

    {Link}

    This just tells me that we're starting to think like a group ;-)

    -Chris

    • avatar
    • Jake
    • Wed 1 Dec 2004 09:13

    Great minds do think alike Chris. The greatest minds don't bother thinking though. They just steal ideas ;o)

    Joking! I didn't know you'd done that. Honest.

    This tip isn't really something I can claim to have "come up with". It's just something that a lot of us do that I wanted to pass on to those that don't...

  5. Hey Jake

    Just wanted to mention that in reference to your "time saving method" there is a new @ function in R6. "@WebDbName"....It returns the URL encoded name of the database.

  6. Hey Jake,

    Like you said before, it'll get a larger audience here and, IMHO, if we all start developing our applications in this way (did someone say something about a Domino Development Standards movement?!?) it'll ease the "picking-up-someone-else's-work"-type development and maintenance.

    Looking forward to tomorrow's tip...

    -Chris ;-)

    • avatar
    • Gaston
    • Wed 1 Dec 2004 13:03

    Tips week !!! Because things like this, I DO love codestore !

    Thanks Jake

    • avatar
    • ShivanD
    • Wed 1 Dec 2004 14:00

    Looking forward to the next tip!

    cheerz

    Karel

    • avatar
    • luca
    • Tue 13 Jan 2004 02:20

    Webdav do this, automatically.

  7. Hi Jake and all !

    Simple but it was to think it!

    Thanks,

    Thierry

  8. luca,

    Webdav however requires a windows-based server (YUK)!

    -Chris

    • avatar
    • Jake
    • Tue 13 Jan 2004 08:26

    Is that right Chris? That would explain why I am having problems with it on my Linux server. It lets me run it but all I get is errors from clients that connect. I remember one did have some success though. Strange.

  9. Note: WebDav also adds a directory/folder object to your notes database resources when your create a resource in a subfolder from the WebDav client.

    Always fancied writing a WebDav agent for a documents in a Notes database. Should be easy enough hmm another project.

    John Z

  10. That's right Jake... as far as I can tell. That's why we can't/don't use it for our hosting company - I'd love to give people native FTP access, but webdav requires M$ to get the job done from what we've seen, and we're just not willing to go that route.

    Hopefully... someday...

    -Chris

    • avatar
    • Edie
    • Thu 24 Aug 2006 08:33 PM

    I just find this article.Oh,it's 2006.But this bolg gives me some suggest.

    But I want to know how to carry out with NOTES 5.

    Just like the method laurens says?

    Please give me an answer!!

    Thanks!!

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 12 Jan 2004

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content