Company Directory - showing "category" in summary page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tonypb
Forum Members
Forum Members
Posts: 104
Joined: Tue Nov 20, 2007 12:16 am

Company Directory - showing "category" in summary page

Post 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?
patino-burch design
Anthony Patino-Burch
r steeltje
Forum Members
Forum Members
Posts: 37
Joined: Tue Mar 11, 2008 12:43 pm

Re: Company Directory - showing "category" in summary page

Post 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
User avatar
tonypb
Forum Members
Forum Members
Posts: 104
Joined: Tue Nov 20, 2007 12:16 am

Re: Company Directory - showing "category" in summary page

Post by tonypb »

sorry... no solution yet
patino-burch design
Anthony Patino-Burch
User avatar
tonypb
Forum Members
Forum Members
Posts: 104
Joined: Tue Nov 20, 2007 12:16 am

Re: Company Directory - showing "category" in summary page

Post 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
patino-burch design
Anthony Patino-Burch
r steeltje
Forum Members
Forum Members
Posts: 37
Joined: Tue Mar 11, 2008 12:43 pm

Re: Company Directory - showing "category" in summary page

Post by r steeltje »

i didn't expect a big issue, after all it works just fine in the detail template!

/dvh
User avatar
amh
Forum Members
Forum Members
Posts: 187
Joined: Sun Apr 17, 2005 2:40 pm

Re: Company Directory - showing "category" in summary page

Post 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
__/\_|\/|_|-|__  --  designer not coder
L84DNR
Forum Members
Forum Members
Posts: 18
Joined: Fri Aug 29, 2008 10:43 pm

Re: Company Directory - showing "category" in summary page

Post 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  ;D

Could you lead me in the right direction for some instruction on adding a dropdown list of the categories in the summary page.

Thanks,
Sonya

Re: Company Directory - showing "category" in summary page

Post by Sonya »

Open file modules/CompanyDirectory/action.default.php and find the line:

Code: Select all

$entryarray[] = $onerow;
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}
User avatar
amh
Forum Members
Forum Members
Posts: 187
Joined: Sun Apr 17, 2005 2:40 pm

Re: Company Directory - showing "category" in summary page

Post 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!
__/\_|\/|_|-|__  --  designer not coder
schipper
Forum Members
Forum Members
Posts: 42
Joined: Wed Dec 17, 2008 8:45 pm

Re: Company Directory - showing "category" in summary page

Post 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"
JeremyBASS

Re: Company Directory - showing "category" in summary page

Post 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
User avatar
barboni
Forum Members
Forum Members
Posts: 68
Joined: Thu Nov 30, 2006 7:56 pm

Re: Company Directory - showing "category" in summary page

Post by barboni »

JeremyBASS wrote: 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

Well, not working for me. Help!
blure

Re: Company Directory - showing "category" in summary page

Post 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.
Last edited by blure on Sun Aug 22, 2010 9:09 pm, edited 1 time in total.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

Re: Company Directory - showing "category" in summary page

Post 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}
Post Reply

Return to “Modules/Add-Ons”