Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: article_categories plugin issue

article_categories plugin issue 5 years 1 week ago #67583


  • Posts:17
  • stephrac74's Avatar
  • stephrac74
  • Fresh Boarder
  • Offline
  • Karma: 0
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
The administrator has disabled public write access.

Re: article_categories plugin issue 5 years 6 days ago #67708


  • Posts:7299 Thank you received: 529
  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Moderator
  • Offline
  • Karma: 134
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
===============================================
Last Edit: 5 years 2 days ago by TheMuffinMan.
The administrator has disabled public write access.

Re: article_categories plugin issue 5 years 5 days ago #67806


  • Posts:17
  • stephrac74's Avatar
  • stephrac74
  • Fresh Boarder
  • Offline
  • Karma: 0
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
The administrator has disabled public write access.

Re: article_categories plugin issue 5 years 2 days ago #67968


  • Posts:7299 Thank you received: 529
  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Moderator
  • Offline
  • Karma: 134
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
===============================================
The administrator has disabled public write access.
The following user(s) said Thank You: stephrac74

Re: article_categories plugin issue 5 years 2 days ago #67998


  • Posts:17
  • stephrac74's Avatar
  • stephrac74
  • Fresh Boarder
  • Offline
  • Karma: 0
Hi Markus,

This works fines !
Thanks a lot
Cheers
Stephane
The administrator has disabled public write access.

Re: article_categories plugin issue 3 months 1 day ago #183971


  • Posts:11
  • fyistudio's Avatar
  • fyistudio
  • Fresh Boarder
  • Offline
  • Karma: 0
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?
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ForumSupport, pedro81, tomeperica
Time to create page: 0.067 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 70!

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.