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: 7339
  • Karma: 139
  • Thank you received: 535

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

===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#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: 7339
  • Karma: 139
  • Thank you received: 535

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

===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#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.102 seconds

News and Updates

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

New extension AnalyticsAnywhere released!

Track website visitors no matter if ad blockers are enabled! Check it out!

Lifetime Subscription

Special Offer! Get lifetime access to all of our current and future products and 2 years of professional support -- 149 for only 90!

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, WordPress® plugins, Joomla!® templates   this means, by purchasing a Lifetime 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 1-Year or Lifetime 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!

Pro Support Renewal Plans

If you just need professional support and no further access to downloads or simply want or need to renew professional support, you may choose between various support plans from here.