Jump to content

How to structure my pages?


Barido
 Share

Recommended Posts

Hey guys,

I'm a designer/developer (definitely in that order) very new to Processwire and hoping you can give me some direction on setting up the structure of my first PW site. I'm actually looking at switching an existing site to ProcessWire as it's due for a re-design and I like the functionality/simplicity of the platform. It was originally in wordpress but the client hated the complexity of the admin so I switched to laravel and crafted a really simple admin interface (attached below).

Basically the site just lists jobs. Existing jobs are usually set to inactive once their filled. Occasionally a candidate ends up pulling out on a role so the job gets re-instated as active. As you can see it's pretty easy to switch a job from active to in-active and vise versa without having to go in the job and change a field. Is there an easy way to achieve the same functionality within the ProcessWire admin interface?

The closest concept I can think of out of the box is having two parent pages 'Active Jobs' and 'Inactive Jobs'. All jobs are child pages and you could simply move/drag jobs between each parent category. But that would change each jobs URL which I don't really want to do...

Or would I just have one parent 'Jobs' page and have a checkbox field in my child jobs which sets an active/inactive state. Could I set that state directly from the list of jobs rather than having to go into each page, adjust, save?

Any help much appreciated!

Cheers,
Brett
 

admin.png

Link to comment
Share on other sites

Hi Barido,

Welcome to the ProcessWire forums. :)

I think there will be a number of solutions you can choose from. A few that occur to me are below.

1. Without using any modules and just working with the default Pages tree, you could use either the Published/Unpublished state or the Hidden/Unhidden state of the job page to switch a job from Active to Inactive (or vice versa). These states can be set directly from the Pages tree without needing to open the page for editing, as shown in the screenshot below. If inactive jobs need to be shown on the website front-end then the Hidden/Unhidden state would be the one to go with. In your templates you can test for the hidden state using the $page->isHidden() method.

2016-07-09_171135.png

 

2. You could use the Batch Child Editor module to toggle the Published/Unpublished or Hidden/Unhidden state.

post-985-0-98642800-1432782769.png

 

3. You could purchase the Lister Pro module. This module has a number of cool features, one of which is the inline editing of page fields directly in the page list. So if you wanted to use a checkbox field in the job page to store the active/inactive state you could toggle this field via Lister Pro.

screen_shot_2016-05-09_at_6_38_55_am.900x0-is.png

 

  • Like 7
Link to comment
Share on other sites

@Robin S 's solutions are perfect. My personal favourite would be the first one: just working with the basic page tree and hidden / unhidden or published / unpublished states.

If you want go with another pagefield solution (checkbox), but want to have a good visual sign rendered in the page tree, there are some code examples in the forums here how to use a hook for that.

Other than in the linked example, with recent PW versions, you don't need a module for that. You just can add a code snippet for that hook into your sites init.php. If you need any further help, just ask. :)

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