×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Adding HotSpots Category Description to Map Page

Adding HotSpots Category Description to Map Page 9 years 1 month ago #32541

  • Gary Miller
  • Gary Miller's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0
Hello,
I am wondering if it would be possibly to modify the default.php file for the hotspots layout so that it includes the category description for the category map that is being displayed?
For example, I have Hot Spot Categories A, B and C each with a formatted description added in HotSpots. In the front-end I have three menu items, each displays a specific HotSpots category Map. It would be great if I can then have the option to display the Description for the specific category beneath the Map.
I know I could do this with a custom module added the the specific page although that would require a user to go through a number of extra steps and know more about Joomla's functionality then the user may have. As the information is already in the HotSpots' database and as the page is already displaying the map for a specific category it would make much more sense to have the ability to show the description automatically. This feature is not currently available although would anyone know if it would be possibly to modify the existing hotspots template and add the code to do this? If so, any recommendation for what code to add?

Thanks!

Adding HotSpots Category Description to Map Page 9 years 1 month ago #32572

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Gary,
It certainly is possible. You could fetch the Hotspots settings (the hotspot settings is where we hold the category id that is selected for the current page). Then you would have to grab the categories.
$categories = JCategories::getInstance('Hotspots')->get()->getChildren();

You would have to search withinthe categories for the category that you need. Hm, actually. If you already have the selected category you could do:
$category = JCategories::getInstance('Hotspots')->get($catid);

This should return the currently selected category and then you could do $category->description to show the description.

Regards,
Daniel
  • Page:
  • 1
Time to create page: 0.155 seconds