Stylesheet to filter job postings by location
Hi,
I am working on updating our job postings page to organize openings by location, since we have five locations where we offer classes. Attached is a screenshot of the index block as well as the datadef and stylesheet, where I am attempting to filter openings by location, using a stylesheet I'm trying to repurpose for that list. The HR person maintaining the site selects the location choice from the dropdown and my idea is to have a listing filtered by each dropdown choice. I can't seem to get any output when I attempt to filter the "location" that's in the page data. Ideas?
I admit to infrequently tweaking styles in Cascade and being still rusty with xslt. Thought about doing something by content type but it might be too burdensome for the HR person to handle and redundant since the datadef handles page output listing location - I'd rather filter that data.
Ed Welch
Assistant Director of Communications and Web Coordinator
Southern Wesleyan University
864-644-5328
864-506-0419 (mobile)
www.swu.edu<http://www.swu.edu/>
[Description: SWU-Wordmark-160]<http://www.swu.edu/>
[Description: facebook1]<http://www.facebook.com/southernwesleyanuniversity.central> [Description: twitter1] <http://www.twitter.com/SWU_edu> [Description: linkedin1] <http://www.linkedin.com/company/southern-wesleyan-university> [Description: youtube1] <http://www.youtube.com/user/southernwesleyanuniv>
- hr-Stylesheet-filter-jobposting-by-location.txt 5.7 KB
- hr-index-block.JPG 54.2 KB
- hr-datadef-job-posting.txt 1.3 KB
-
image002.jpg
661 Bytes
-
image005.jpg
642 Bytes
-
image001.gif
5.2 KB
-
image004.jpg
699 Bytes
-
image003.jpg
619 Bytes
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Ryan Griffith on 08 Aug, 2012 03:13 PM
Hi Ed,
Could you also attach the XML generated by the Index Block so I would be able to do some testing on my local instance? Thanks!
3 Posted by Welch, Ed on 08 Aug, 2012 03:31 PM
Here it is...
Ed
Support Staff 4 Posted by Ryan Griffith on 08 Aug, 2012 03:37 PM
Ed, hope you don't mind but I removed the pasted XML and attached it to this post.
Support Staff 5 Posted by Ryan Griffith on 08 Aug, 2012 03:57 PM
Ed, just wanted to clarify, are you looking to output a list of links to all postings organized by location?
6 Posted by Welch, Ed on 08 Aug, 2012 04:03 PM
Ryan,
I want to break out the listing (see online http://swu.edu/hr/1-openings_faculty/index.htm ) into something like this:
Employment Opportunities - Faculty
Various Locations:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Central:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Charleston:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Columbia:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Greenville:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
North Augusta:
Full-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Part-time -
JOB POSTING1
JOB POSTING2
JOB POSTING3
Support Staff 7 Posted by Ryan Griffith on 08 Aug, 2012 06:29 PM
Hi Ed,
You would definitely need to use the
<xsl:key>element to group the pages by location. For more information about this XSLT element, see this page. The following should get you started:Note: there was quite a bit of code that was unnecessary so I hope you don't mind that I started from scratch.
One suggestion may be to add an additional "Job Length" field that identifies the posting as Full Time or Part Time, this way you can easily sort or display listings based on this value (like your example output above).
Please let me know if you have any questions.
Thanks.
8 Posted by Welch, Ed on 08 Aug, 2012 06:34 PM
I'll give it a try. Thanks, Ryan.
Ed
9 Posted by Welch, Ed on 08 Aug, 2012 06:52 PM
Ryan,
Okay this looks good.
If I were to add a "job-length" field to break out fulltime and part-time, I'm sorting through the data using two different criteria. Does it make more sense for me to output data like this?
Full-Time positions
Various locations
-Job posting
-Job posting
Central
-Job posting
-Job posting
Charleston
-Job posting
-Job posting
Part-Time positions
Various locations
-Job posting
-Job posting
Central
-Job posting
-Job posting
Charleston
-Job posting
-Job posting
Or can I do the breakdown under each location? I guess I'm still trying to get my head around how to style that. Thanks for your help!
Ed
Support Staff 10 Posted by Ryan Griffith on 08 Aug, 2012 07:04 PM
You could go either way there. I believe you would have to create a second key and do something similar to my example, but nested under one another.
As for the structure, it really depends on the audience. You may want to ask which is more important to the end-user while scanning, location or length, and go from there.
11 Posted by Welch, Ed on 08 Aug, 2012 07:10 PM
Okay. I'll try doing a second key and nesting. Thanks, Ryan.
Ed
Support Staff 12 Posted by Ryan Griffith on 08 Aug, 2012 07:13 PM
Not a problem, Ed. Also, would it be alright if I make this discussion public? Perhaps someone from the community may chime in as well.
13 Posted by Welch, Ed on 08 Aug, 2012 07:24 PM
Sounds good. Thanks again, Ryan.
Ed
Tim closed this discussion on 27 Aug, 2012 05:18 PM.