Company Directory module - display content of custom fields

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
cyberman

Re: Company Directory module - display content of custom fields

Post by cyberman »

You can join to this project too :).
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Company Directory module - display content of custom fields

Post by climberusa »

Can anyone tel me how to display The Category in the Summary Template? I'm trying to use


{$entry->categorytext}


But I'm just getting blanks. Thanks for your help!
skypanther

Re: Company Directory module - display content of custom fields

Post by skypanther »

The code doesn't seem to support it. I'm making some other changes that I hope to post soon. I'll see about adding this in while I'm at it.

Tim
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Company Directory module - display content of custom fields

Post by climberusa »

Great, I appreciate your help!
skypanther

Re: Company Directory module - display content of custom fields

Post by skypanther »

Attached is an attempt at some additional functionality for this module. It needs testing before any serious release.
  • Output categories as either select (drop-down) list or within a DIV
  • Choose to output, supress, or exclusively display the categories with DIV categories output--e.g. by choosing to disply just the categories, you can end up with one page that shows just your categories and no companies; clicking on one shows all the companies within that category. This doesn't work with the select list style output of categories.
  • If you use the two-page thing just described, you can also add a "breadcrumb" link back to your categories page
  • I've updated and added various style selectors to give you more flexibility with adding CSS styles to the various elements. All the selectors begin with CompanyDirectory so that you can easily recognize and format the elements.
  • I've added documentation on using the module and its options
Rename your existing modules/CompanyDirectory/action.default.php to something like action.default_stock.php and then put this one in its place (rename as __.php not ___.txt). Same for the lang/en_US.php file: rename and put this one there.

@climberusa  I have not added in the ability to output the category name as you requested. The necessary SQL query was eluding me so I have to play with it some more.

If it works, I'll work on getting this into the project properly.

Tim

[gelöscht durch Administrator]
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Company Directory module - display content of custom fields

Post by climberusa »

@skypanther: any luck yet on this?
skypanther

Re: Company Directory module - display content of custom fields

Post by skypanther »

Sorry, I haven't had a chance to work on it. Here's what I'm starting from:

Code: Select all

$query = "SELECT * FROM ".cms_db_prefix()."module_compdir_companies c";
if ($inputcat != '')
{
	$query .= " INNER JOIN ".cms_db_prefix()."module_compdir_company_categories cc ON cc.company_id = c.id WHERE cc.category_id = ?";
	$paramarray[] = $inputcat;
}
$query .= " ORDER BY company_name";
If a category isn't specified, the query selects all fields from the companies table. Otherwise, it does an inner join on the categories table and selects only the companies in the given category. Here's the table structure

Image
Image

Here's what the data in the company_categories table looks like:
Image

So, I need to do a double join to pull in the category name. And if a category is specified in the input, I need to pull out just the companies in that category. Apparently, my SQL skills aren't what they should be because complex many-to-many joins like this always give me the fits.

Anyone have some suggestions?

Thanks,
Tim
skypanther

Re: Company Directory module - display content of custom fields

Post by skypanther »

Hmm, I just came across the GetCategoriesForCompany($id) method in the CompanyDirectory class. Could I use it to create the list of categories a company belongs to? I think it would be less efficient than doing it right through the SQL. But, it might get the job done.

Tim
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Company Directory module - display content of custom fields

Post by climberusa »

I wish I could help but m sql skills are infantile at best. I appreciate your effort though!
Jeff
Locked

Return to “Modules/Add-Ons”