Page 1 of 1
Company Directory - showing "category" in summary page
Posted: Tue Mar 11, 2008 12:20 am
by tonypb
I am using "company directory 1.1.3" and would like to show the category underneath each company name in the list of companies (summary template)
In the company details page (detail template) I had modified the code to look like:
Code: Select all
{if $categorytext ne ''}
<tr style="padding-bottom:5px">
<td class="align_top"><strong>Categories:</strong></td>
<td class="align_top">{$categorytext}</td>
</tr>
{/if}
and i thought i could just copy this and place it inside the summary template to show the category but it does not show up... just for the heck of it i tried copying the entire "detail template" inside the "summary template" just to see if maybe i was doing something wrong but... still... no category
I have added the drop down on top of the page so they CAN sort by category but would love to be able to have it show when the page is listing all categories
am i missing some setting i need to change?
Re: Company Directory - showing "category" in summary page
Posted: Wed May 07, 2008 11:29 am
by r steeltje
have you already solved your problem?
i want to know cause i have the same question!
i have copied the following code from the "Default Detail Template" into the Summary Template which i use.
Code: Select all
{if $categorytext ne ''}
Categories: {$categorytext}<br />
{/if}
i expected it to show the categories where this company belongs to, just like it does when i'am linked to the detail template where i copied it from.
anyone else a idea?
/dvh
Re: Company Directory - showing "category" in summary page
Posted: Wed May 07, 2008 11:46 am
by tonypb
sorry... no solution yet
Re: Company Directory - showing "category" in summary page
Posted: Wed May 07, 2008 10:32 pm
by tonypb
r steeltje wrote:
have you already solved your problem?
i want to know cause i have the same question!
i have copied the following code from the "Default Detail Template" into the Summary Template which i use.
Code: Select all
{if $categorytext ne ''}
Categories: {$categorytext}<br />
{/if}
i expected it to show the categories where this company belongs to, just like it does when i'am linked to the detail template where i copied it from.
anyone else a idea?
/dvh
i sent an email to the guy who works on this project and unfortunately this is not possible at this time
to be able to view category next to each company in the main list would be great... to be able to display all companies separated by category would be even GREATER, but for now... it is still GOOD
Re: Company Directory - showing "category" in summary page
Posted: Thu May 08, 2008 8:39 am
by r steeltje
i didn't expect a big issue, after all it works just fine in the detail template!
/dvh
Re: Company Directory - showing "category" in summary page
Posted: Wed Sep 10, 2008 9:23 pm
by amh
Hi!
Does anyone know the solution for this problem? It would be great to have the category in the summary page.
Kind regards andreas
Re: Company Directory - showing "category" in summary page
Posted: Thu Sep 18, 2008 4:44 am
by L84DNR
tonypb,
I'm just getting my feet wet here but have been struggling with this issue for a while now.
After reading yours and anothers post on the drop down option I'm thinking that might be the best direction for now.
I guess my problem is that I have a business directory, that goes to a category list, that goes to a summary page, that goes to a detail page. There is no real intuative way to walk, cookie crumb back to the category list (that I've found)
yes, yes, I know I just use the back button too, but we are dealing with end-users here
Could you lead me in the right direction for some instruction on adding a dropdown list of the categories in the summary page.
Thanks,
Re: Company Directory - showing "category" in summary page
Posted: Sat Mar 07, 2009 3:34 pm
by Sonya
Open file modules/CompanyDirectory/action.default.php and find the line:
Add
BEFORE this line the code:
Code: Select all
$categories = $this->GetCategoriesForCompany($row['id']);
$catnamearray = array();
if (count($categories) > 0)
{
foreach ($categories as $fielddef)
{
$field = new stdClass();
$value = $fielddef->value;
if ($value)
{
$field->id = $fielddef->id;
$field->name = $fielddef->name;
$catnamearray[] = $fielddef->name;
}
}
}
$onerow->categorytext = implode(", ", $catnamearray);
Now you will be able to use categories in the summary template like:
Code: Select all
{if $entry->categorytext ne ''}
Categories: {$entry->categorytext}
{/if}
Re: Company Directory - showing "category" in summary page
Posted: Sun Mar 15, 2009 9:48 pm
by amh
GREAT!!!!! THANKS
If possible please make it as a standard function. This is very useful for navigation e.g. “You are in category: foo.”
@Sonya (in german): Es wäre toll, wenn Du das irgendwie dem Entwickler schicken könntest. So ist es beim nächsten Update vielleicht schon standardmäßig dabei. Danke für die Hilfe!
Re: Company Directory - showing "category" in summary page
Posted: Thu Jan 07, 2010 11:40 pm
by schipper
This works great, but how do you add the Category name up top as a Title, for instance, i am viewing all "Automotive" companies - and want to show that for the page (not for each entry, because they would all say Automotive"
Re: Company Directory - showing "category" in summary page
Posted: Fri Jan 08, 2010 3:33 am
by JeremyBASS
for what it's worth... this is something the doesn't require heck anything...
http://dev.cmsmadesimple.org/projects/modslack
that can grab the cats of a company... Cheers - Jeremy
Re: Company Directory - showing "category" in summary page
Posted: Sun Jun 27, 2010 10:37 pm
by barboni
Well, not working for me. Help!
Re: Company Directory - showing "category" in summary page
Posted: Sun Aug 22, 2010 9:03 pm
by blure
schipper wrote:
This works great, but how do you add the Category name up top as a Title, for instance, i am viewing all "Automotive" companies - and want to show that for the page (not for each entry, because they would all say Automotive"
you can try sorting it by category. {CompanyDirectory sortby="category"}, since "$entry->category" doesnt exist i tried throwing in category variable into "$entry->fax" then sort them by
{CompanyDirectory sortby="fax"}
this is what i do.
edit the "action.editcompany.php"
in line 346
if (isset($fielddef->value))
{
$value = $fielddef->value;
}
change to
if (isset($fielddef->value))
{
$value = $fielddef->value;
if ($value=='1'){
$inputfax=$fielddef->name;
}
}
then
$this->smarty->assign('inputfax', $this->CreateInputtext($id, 'fax', $fax, 30, 255));
to$this->smarty->assign('inputfax', $this->CreateInputtext($id, 'fax', $inputfax, 30, 255));
i hope i didnt miss out some info here.
Re: Company Directory - showing "category" in summary page
Posted: Fri Aug 27, 2010 10:03 pm
by nicmare
schipper wrote:
This works great, but how do you add the Category name up top as a Title, for instance, i am viewing all "Automotive" companies - and want to show that for the page (not for each entry, because they would all say Automotive"
in your CD template:
Code: Select all
{assign var="categorytitle" value=$entry->categorytext}
and in your main template in tag:
Code: Select all
{if $categorytitle}{$categorytitle}{else}your regular title{/if}