Jump to content

document library


loukote
 Share

Recommended Posts

Hi,

being new to PW, i don't have a good overview of the existing modules so i'd like to pull your experience: is there a (simple?) document library module?

The goal is to store and display documents with a description on a page, maybe sorted in categories. Nothing complex. ... I know, i know -- you say that i should grab a template, give it a document, tag and description fields. I should. Should i? Isn't there something done with some more nice tweaks that i would not think of right away.

Thanks!

  • Like 1
Link to comment
Share on other sites

Ooh, ooh, me first! You should grab a template, give it a document, tag and description fields :biggrin:

There's no document library module (that I'm aware of), probably because a module isn't needed for something like this.

For your task the basic item you are dealing with is a document record. This is a collection of information: URI, description, tags. In ProcessWire the 'page' is the unit that is typically used to store a collection of information. And in ProcessWire, a page isn't necessarily a complete page that visitors view on the website front-end; a page can consist of only a title field, and you will probably use something like this for your tags/categories. The broadened definition of 'page' in PW is one of the things that can be confusing at first for new users. It took me a bit of time to adjust my idea of what a page can be.

So as you predicted, you would create a template to use for document records and give it the fields you need. Then you add one page per document under a chosen parent in the page tree. It's up to you whether you make individual document records viewable as individual pages on the website front-end. You might decide you don't need that and only pull in information from the records to display as part of another page (search results or category listings).

A great place to start is Ryan's Skyscrapers profile:
http://demo.processwire.com/
http://modules.processwire.com/modules/skyscrapers-profile/

Replace the concept of 'skyscraper' with 'document' and you'll see how PW can be used as a document library. I did exactly that for the first website I built with PW: http://ref.dunestrust.org.nz/

  • Like 5
Link to comment
Share on other sites

@loukote, has someone already said to you that you should grab a template, give it a document, tag and description fields? :)

As addition to @Robin S, If you don't need to display those single document pages to the front, you don't need a template file. Just create a new template in the backend.

Additionally to my addition: For those cases, doc repository, category repository, etc, I create two templates without a template file:

  • a parent template (REPO)
  • and a child template (ITEM)

The parent template has the following setup:

  • may pages have children: yes
  • can this template be used for new pages: only one!
  • allowed templates for parents: home
  • allowed templates for children: ITEM
  • show in the shortcut menu: no
  • fields: only a title

The child template has this one:

  • may pages have children: no
  • can this template be used for new pages: yes
  • allowed templates for parents: REPO
  • show in the shortcut menu: yes
  • fields: a title and all what is individually needed!

 

In the family settings of templates they are linked to each other. After setup the templates and creating the single allowed parent page in the tree, further no one can create repo items on a wrong place, and you can use the short cut dropdown in the admin for creating new entries!

I propably do create the templates in two simultaneous opened tabs in my browser, because when creating the first one of them, I can not directly link to the other (as it doesn't exist yet). So I go to a second browser tab, create the other template, link it to the first one and save. After that, I can link the first one to the second one too, and I'm finished. :)

And really, you don't need modules for such things, you simply use PW as it is to setup things individually. Simple, easy and fun!

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

pw-template-parent-children-01.png

pw-template-parent-children-02.png

 

pw-template-parent-children-03.png

pw-template-parent-children-04.png

 

pw-template-parent-children-05.gif

  • Like 7
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...