Jump to content

[New project] All kinds of relations between pages


arjen
 Share

Recommended Posts

I'm a seasoned Textpattern user, but since I've found ProcessWire I want to try it. I've read all the topics the last couple of weeks and I think this is possible, but I would like to know it for sure. I'm going to pitch this at my agency.

I've got the following idea:

Mainpages

Home

Workfields

-Workfield 1

-Workfield 2

-Workfield etcetera

Employees

-Employee 1

-Employee 2

-Employee etcetera

Work

-Projects

--Project 1

--Project 2

--Project etcetera

-Clients

--Client 1

--Client 2

--Client etcetera

Business

-Business 1

-Business 2

-Business 3

Also mainpages but not visible in the main navigation

-News

--News article 1

--News article 2

--News article etcetera

-Contact

-Sitemap

The idea: I want to be able to link the employee to one or more workfields, projects and businesses. This has to be a two-way relation. Let's say one an employee page I would like to list the relation with the projects, the workfields and the businesses. On the projects page I would like to list the employees who have a relation. Etcetera. Also projects needs to have a relationship with workfields and business. This is roughly the same idea as with the employees. I think this is where ProcessWire should come in very handy.

The thing which confused me a little bit is that I would like to have a relationship between a newsarticle and all other types. So if the webmaster would post a newsarticle he should be able to link this to any other page in the website. This newsarticle should be visible on all pages who have a relation with the article.

The main point of choosing PW over TXP is the flexibility which looks awesome to me. I could see this working in TXP, but it wouldn't be very userfriendly to define those relationships when adding some content.

Is this possible at all? Is the news relationthing possible? Does this in any way have an impact on the loadingtime of the page? Since there are a lot of relations to define.

Thank you all very much for thinking along in advance. Your community seems very nice and reminds me of the nice people in the TXP forums.

ps. I've seen some Dutch translationwork has been done. Guess I am going pick that up too.

ps2. My developer wants to use Joomla!, so any thoughts on applying this structure userfriendly would be nice too.

Link to comment
Share on other sites

TXP user here, too. :) I was a little confused by terminology--not sure what a "workfield" is, but I am creating a similar project in ProcessWire right now--a business dashboard. As far as I can tell, what you want to do is possible. With the relationships, AFAIK it's very similar to setting up e.g. a tag or category system with a blog.

For the News / Related Items portion, you can add a field to your News template that lets you select any number of pages on the website. Then you would just put in code that renders those items as linked titles. This is kind of open-ended (maybe a bit annoying if you have thousands of items from which to choose) but it would be very straightforward to use. Maybe Ryan or others could suggest alternate approaches.

Link to comment
Share on other sites

Arjen, It will be very easy to achieve that structure with pages in processwire, alsothe ones that are not visible in the navigation, because you can choose this on templates, or per page.

You can also link the pages very easily using the page fieldType http://processwire.c...page-fieldtype/

Funny, this is the second time I link to this in the forums this week...

edit: sorry Marc, I just suggested the same thing as you...

edit2:

(maybe a bit annoying if you have thousands of items from which to choose)

Depending on what you want to achieve, you can make the selection smaller with custom code, showing for instance only the most recent pages under one parent.

Link to comment
Share on other sites

@MarcC, a workfield is a type of business. Let's say farming or banking. I would guess this doesn't make a difference. ;)

@diogo, maybe I didn't make myself clear. My apologies. The structure itself should be very easy. I'm a bit concerned about the relations, but like MarcC mentoined the news relation to all pages is possible. I think I've found the forum post you are talking about. Thanks for your thoughts on listing the pages. What other post are you talking about? Perhaps I could learn something from it too.

I have enough information at the moment. But if anyone would like to share I am more than happy to know!

Thanks guys!

Link to comment
Share on other sites

You were concerned about performance if there are many relations defined. Page relations are fast, since they get pages directly with ID so I don't believe there will be any issues in this regard. Haven't really tried with that many relations (probably something like 20 is my max), but I assume that it will be fast. Of course if have something like 100 related pages and then you need to load all those pages in memory, then you will have some challenges for sure.

What is important though is to choose right kind of inputfield (it defines HOW you choose relative pages when editing). If you want to choose any pages from your site I think then you will have two options: PagelistSelectMultiple or the new PageAutocomplete. Other inputfields need to load all the pages to show the available pages for you, so they will be impossible to use if you have many pages. But those two that I mentioned are very handy in your situation, since first will let you browse page tree and other one is ajax search (start typing and it will suggest pages for you).

Link to comment
Share on other sites

Arjen, I think that ProcessWire will do exactly what you are looking for here quite easily. For your news page relations, I would echo what Antti said and suggest using either PageListSelect/PageListSelectMultiple or PageAutocomplete. Neither of those are affected by quantity, so will remain fast in the page editor regardless of how many potential page relations there are. Quantity of selected page relations is also unlikely to be a problem. When you load a page, PW doesn't load the data for that page (except for fields where the 'autojoin' option is used), so typically a page will only load with it's 'title' field. It won't load others until you specifically ask for them, like $page->body. In this manner, you can be working with hundreds of pages in memory without much worry of slowing things down. Though this is all behind-the-scenes stuff, and not something you usually need to think about. PW will make you think all the data is loaded and ready to use, but it stays selective behind the scenes to make sure it's never loading stuff you don't need at the time.

Link to comment
Share on other sites

@diogo, no worries. Glad you pointed me to the video! Thanks!

@apeisa, thanks for your thoughts. I would guess an ajax search to find the specific pages would be quite userfriendly.

@ryan, no need for concerns on that part, thank you for your detailed explanation.

I will pitch this to my company. I'm already convinced ;)

Link to comment
Share on other sites

  • 3 weeks later...

Got it done. Some folks wanted WordPress on this site. But I'm glad it will be ProcessWire! Will keep you guys posted on the project. I am confident everyone here will be pleased after we complete the site.

Thank you all for your input!

  • Like 2
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...