Product Updates
Joomla 5.2.3 Compatibility for JA Templates, Bug Fixes, and More

ALL groups page. When anyone uses the group category dropdown, it lists all the groups within that CATEGORY. The header says: GROUPS.

I want to display the CATEGORY NAME and CATEGORY DESCRIPTION at the top of the list of groups found in that category.

I want to show group category name like: <?php echo GROUP CATEGORY NAME; ?>
I also need to show the category description like <?php echo GROUP CATEGORY DESCRIPTION; ?>
What are the exact codes for these please?
I am using template over ride in my templates HTML folder, and groups file base.php

I want to place these on the groups listing page as per images:

Alternatively, I could place the selected "category name and description", just under or on top of the area where it says ' No groups created yet '. (Obviously this will disappear when groups exit)

(When creating group categories there is feature to add category descriptions too. I want to use these)
----------------------------------.

I would like to do the same for PAGES. To show Page Categories and Page Category Descriptions similar to the request above for Group categories and group category descriptions. Again, what are the php code calls for these too, please.

    maz001
    Hi
    I am afraid this is not simple task to do, this needs custom works in the JomSocial to apply new query to call the description. I shared it with dev team member to guide you on this for changes, as this is not something easy to do .

    7 days later

    maz001
    Hi,
    You can add this code

        $catid = JFactory::getApplication()->input->getInt('categoryid');
        $desc = '';
        if ($catid) {
            $db = JFactory::getDbo();
            $query = "SELECT `name`, `description` FROM `#__community_groups_category` WHERE id = $catid";
            $result = $db->setQuery($query, 0, 1)->loadObject();
            if ($result) {
                $title = $result->name;
                $desc = $result->description;
            }
        }

    to line 54
    of file components\com_community\templates\jomsocial\layouts\groups\base.php

    then echo $title and $desc any where you want

      manhta

      Thank you, that worked great on Pages, Events and Groups (all using base.php files)

      In the same way as above , when someone chooses the profile type dropdown, I also want to show the POFILE TYPE Name and Descriptions on the ALL MEMBERS page (I believe it is people.browse.php file)
      I tried the following database call but I cant seem to get the 'profile type' and 'details'

       <?php
        $catid = JFactory::getApplication()->input->getInt('categoryid');
          $desc = '';
          if ($catid) {
              $db = JFactory::getDbo();
              $query = "SELECT `name`, `description` FROM `#__community_profiles` WHERE id = $catid";
              $result = $db->setQuery($query, 0, 1)->loadObject();
              if ($result) {
                  $title = $result->name;  
                  $desc = $result->description;
              }
          }
        ?>

      Apologies, I am not very good with code 🙁

        maz001
        Put this to line 32 of file people.browse.php

                <?php 
                $profiletype = JFactory::getApplication()->input->getInt('profiletype');
                $desc = '';
                if ($profiletype) {
                    $db = JFactory::getDbo();
                    $query = "SELECT `name`, `description` FROM `#__community_profiles` WHERE id = $profiletype";
                    $result = $db->setQuery($query, 0, 1)->loadObject();
                    if ($result) {
                        $pageTitle = $result->name;  
                        $desc = $result->description;
                    }
                }
                ?>

        then use $pageTitle and $desc

        Write a Reply...
        You need to Login to view replies.