article_categories plugin issue

  • stephrac74
  • stephrac74's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 0

stephrac74 created the topic: article_categories plugin issue

Hi,

In my website I want to seize forms and display forms using the joomla category as a sort key.

When In my form I set the field to 'article_categories', my categories are correctly displayed on the listbox. But when I select one, the category name is then replaced by its Joomla ID number.... which is less fun !
Any way to come back to the category name to be displayed instead of the category ID ?

www.revue-hyper.fr

Thanks
Stephane
#67583
  • Posts: 7459
  • Karma: 147
  • Thank you received: 545

TheMuffinMan replied the topic: Re: article_categories plugin issue

Hi,

to let the category title appear in the column, please add as-is into the Item Wrap Code of the category column in the view setup:
<?php $db = JFactory::getDBO(); $db->setQuery("Select title from #__categories Where id = " . intval($value)); $value = $db->loadResult(); ?>

To use the category title in the Content Template, please go to the Content Template tab and add this (and change "CATEGORY-FIELDNAME" with the field name for the category):
$db = JFactory::getDBO(); 
$db->setQuery("Select title from #__categories Where id = " . intval($value)); 
$category = $db->loadResult();
$items["CATEGORY-FIELDNAME"]["value"] = $category;

Please let me know how it went!

Regards,
Markus

===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#67708
  • stephrac74
  • stephrac74's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 0

stephrac74 replied the topic: Re: article_categories plugin issue

Hi Markus,

I've added the wrap code as it in the columns called 'rubrique' of my view and added the Content Template code and replaced
"CATEGORY-FIELDNAME" by "rubrique" which is the name of my view column I want to display categories...

There is now nothing displayed in the column :
www.revue-hyper.fr

An idea of what could be wrong with what I've done ?

Thanks a lot for your support
Cheers
Stéphane
#67806
  • Posts: 7459
  • Karma: 147
  • Thank you received: 545

TheMuffinMan replied the topic: Re: article_categories plugin issue

Hi,

please try this in Item Wrap Code
<?php $db = JFactory::getDBO(); $db->setQuery("Select title from #__categories Where id = " . intval($value)); $value = $db->loadResult(); ?>

Regards,
Markus

===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#67968
The following user(s) said Thank You: stephrac74
  • stephrac74
  • stephrac74's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 0

stephrac74 replied the topic: Re: article_categories plugin issue

Hi Markus,

This works fines !
Thanks a lot
Cheers
Stephane
#67998
  • Posts: 11
  • Thank you received: 0

fyistudio replied the topic: Re: article_categories plugin issue

I know this is an old post but this is the only one of these types of questions that have gotten answered so didn't want to open another topic. I am using the code mentioned in this post. While it works great in the list form when editing the item its not showing up in my Content Template. Its just blank. Any ideas?
#183971
Moderators: ForumSupporttomeperica
Time to create page: 0.054 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Special Offer! Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for only 55!

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, WordPress® plugins, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here