Ralf

Topic: Want to show jobs based on job-type ... something strange

I'm not an expert, I guess you will see. But I'm playing around with my modified standard-template and also some core files.
Here is what I want to do: Show 4 sections (4 divs - no prob here) on the hp, where you can find jobs from my 4 job-types. I modified home.tpl (show you only the part which is important - I guess - and only one of the 4 parts)

Code:
<div id="vollzeit">
{if $latest_jobs_1}
<span id="latestjobs">{$translations.homepage.vollzeit_jobs}</span>    
{foreach item=job from=$latest_jobs_1}
.... div, rows, etc are here ...
{/foreach}
<div view all comes here />
{/if}
</div>

I also added these corresponding lines to my page_home.php

Code:
define('NUMBER_OF_LATEST_JOBS_TO_GET_1', $settings['latest_jobs']);
$smarty->assign('latest_jobs_1', $job->GetJobs(0, 0, NUMBER_OF_LATEST_JOBS_TO_GET_1, 0, 0));

Ok, all 4 sections pick the number for latest jobs, that you put into the admin. But from what I guess (because I found something in the class.Apii.php) the first number in brackets is the job-type. I tried to change it (1 - 4: my jobtypes) but it always shows all latest jobs. I even tried the name of that jobtype value - always all jobs - I changed the second number to a category ID and that works right away - only jobs from that category show in that div. Any ideas what I'm doing wrong or keep forgetting?
Thanks in advance and sorry for all the words - hope it's detailed enough!
Cheers, Ralf

New jobboard for germany: www.jobboard-deutschland.de it's getting better every day!
Thanks to everyone -specially within this forum- for supporting!

Ralf

Re: Want to show jobs based on job-type ... something strange

Hi there, even if you don't have time - do you have any ideas that I could try? Or if it is not clear, I can provide more information.
Cheers, Ralf

New jobboard for germany: www.jobboard-deutschland.de it's getting better every day!
Thanks to everyone -specially within this forum- for supporting!

Ralf

Re: Want to show jobs based on job-type ... something strange

Come on guys - where should I start?
Cheers, Ralf

New jobboard for germany: www.jobboard-deutschland.de it's getting better every day!
Thanks to everyone -specially within this forum- for supporting!

putypuruty

Re: Want to show jobs based on job-type ... something strange

Hi, Ralf!

Sorry for such a late response. You were on the right track but it didn't work for you because there's a small bug in the GetJobs method.

To fix it, open _includes/class.Job.php and find the GetJobs method. You'll notice that the type_id parameter appears twice in the parameters list: in the first position and also in the penultimate position. You'll have to remove the latter appearance. Now, open page_home.php and replace this line

Code:
$smarty->assign('spotlight_jobs', $job->GetJobs(0, 0, NUMBER_OF_SPOTLIGHT_JOBS_TO_GET, 1, 0, 0, 0, 0, 1));

with

Code:
$smarty->assign('spotlight_jobs', $job->GetJobs(0, 0, NUMBER_OF_SPOTLIGHT_JOBS_TO_GET, 1, 0, 0, 0, 1));

I've removed a 0 corresponding to the duplicate type_id parameter.

Now, replace the first parameter in the call to the GetJobs method with the ID of your desired job type.

Hope it helps!

putypuruty

Re: Want to show jobs based on job-type ... something strange

Because this behaviour is a bug in jobberbase, I've created the following bug report http://code.google.com/p/jobberbase/issues/detail?id=33 to track it. Note that the bug is now fixed and will be part of the next release.

Ralf

Re: Want to show jobs based on job-type ... something strange

Heeey putypuruty,

thanks so much! Works perfectly with what I created before. Can't wait to show off how it looks - not quit ready yet - but coming soon! That was a big step for me. Thanks for your support!
Cheers, Ralf

New jobboard for germany: www.jobboard-deutschland.de it's getting better every day!
Thanks to everyone -specially within this forum- for supporting!

Ralf

Re: Want to show jobs based on job-type ... something strange

ah - btw. you can see this live on the frontpage of my jobsite. Feel free to comment - but as there is also one thread in the show-off topic, comment the right one ;o)
Cheers, Ralf

New jobboard for germany: www.jobboard-deutschland.de it's getting better every day!
Thanks to everyone -specially within this forum- for supporting!