Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • southsouthworld Friend
    #1058154

    Hi Joomlart team,

    I would like some help, my map pages are set as K2 category menu types. I would like to copy the code from the JAK2 Filter component folder to allow 50-100 K2 Items to appear on the map. Can someone help me to locate the code for this so I can get the K2 category menu type to show more than 6 K2 items on the page at a time?

    See the Africa map as an example: http://africa.southsouthworld.org/

    Kindest regards,
    Alyssa

    Luna Garden Moderator
    #1058404

    Number Item display in List depends on how you config on JA K2 Filter or the Menu Item.
    In JA K2 Filter, you set like this capture: https://static.joomlart.com/images/userguide/jaec/ja_k2_filter/update/component-item-layout.png In primary text, set to 50 Item for example.
    For menu, just the same.
    Remember, if you set to show too many item, it’ll slow down your site speed.

    southsouthworld Friend
    #1058589

    Thank Luna for the reply. However the problem is that JA K2 Filter menu type is not compatible with the multiple K2 categories component I installed, so for the other map pages they configured as K2 category menu types. I hope that makes sense. So now my task is to copy the codes from JA K2 Filter folder across to the K2 folder so I can get K2 category menu type to display more than 6 K2 items on the page at a time.

    Kindest regards,
    Alyssa

    Luna Garden Moderator
    #1058885

    In K2 Menu Item setting and K2 Options also have the setting to choose how many K2 Items you want.

    Here is the code in JA Directory show the Map, remember to put them to category.php in folder HTML overwrite of K2.

    <?php $locations = (object) array(
          'location' => new stdClass(),
          'latitude' =>  new stdClass(),
          'longitude' =>  new stdClass(),
          'info' =>  new stdClass()
        );
        $i = 0;
        $baseURL = JUri::base();
        $sections = array('leading', 'primary', 'secondary', 'links');
        foreach($sections as $section) {
          if(isset($this->{$section}) && count($this->{$section})) {
            foreach($this->{$section} as $key=>$item) {
              $latitude = $longitude = '';
              if(count($item->extra_fields)) {
                foreach ($item->extra_fields as $extraField) {
                  if($extraField->alias == 'latitude') $latitude = $extraField->value;
                  if($extraField->alias == 'longitude') $longitude = $extraField->value;
                }  
              }
    
              if($latitude && $longitude) {
                $catParams= new JRegistry($item->categoryparams);
                $icon = $catParams->get('category_marker', 'images/joomlart/directory-icons/default-marker.png');
                $icon = $baseURL.'/'.$icon;
    
                $locations->location->{$i} = '';
                $locations->latitude->{$i} = $latitude;
                $locations->longitude->{$i} = $longitude;
                $locations->info->{$i} = '<a class="marker-title" href="'.$item->link.'">'.$item->title.'</a>';
                foreach ($item->extra_fields as $key=>$extraField): 
                if($extraField->value != ''):
                 if(($extraField->type != 'header') && ($extraField->alias != 'latitude') && ($extraField->alias != 'longitude')):
                  $locations->info->{$i} .= '<div class=""><span class="">'.$extraField->name.':</span>';
                  $locations->info->{$i} .= '<span class="">  '.$extraField->value.'</span></div>';
                 endif;
                endif; 
                endforeach; 
                $locations->info->{$i} .= '<img class="marker-img" src="'.$item->imageSmall.'" alt="" />';
                @$locations->icon->{$i} = $icon;
                $i++;
              }
            }
          }
        }
        if($i) {
          $jamap = "{jamap locations='".json_encode($locations)."' map_width='100%' map_height='455' zoom='4' disable_scrollwheelzoom='1' display_scale='1' display_overview='1'}{/jamap}";
          echo $jamap;
        }
      ?>

    southsouthworld Friend
    #1058931

    Thank you very much Luna! 😀

    southsouthworld Friend
    #1059232

    Hi Luna I just looked at the code, the codes in the com_k2 folder for category.php appear to already have the same codes.

    Please help me find the code to allow me to change the primary count of K2 items on the map for K2 Category menu type. I need to change the primary count for K2 categories menu type, but when I try to change the primary count of 4 on Joomla admin panel it won’t let me click on it. See the following screenshots below.


    1. Screen-Shot-2017-08-29-at-8.59.06-pm
    2. Screen-Shot-2017-08-29-at-9.01.16-pm
    Luna Garden Moderator
    #1059442

    In Menu Item, set Inherit from component to No, you will be able to change the value.

    southsouthworld Friend
    #1059701

    Hi Luna can you please kindly tell me where I can find the value to set inherit from component to "no" in the menu item?

    Kindest regards,
    Alyssa

    southsouthworld Friend
    #1060285

    Hi Luna,

    I realised that the menu item for K2 category type does not have the option to set inherit from component to no. This is only available to change in the menu item for JaK2 filter item list type. See in this link: http://www.southsouthworld.org/administrator/index.php?option=com_menus&view=item&layout=edit&id=226

    Please kindly let me know what I can do next?

    Look forward to hearing from you.

    Luna Garden Moderator
    #1060647

    For example menu Item ID is 226 set to show category Africa ID 39. The layout of Africa follow the setting of Parent Category which is Directory. Just change the Display setting of Directory corresponding change the Display of Africa.
    If you want to Africa has its own setting, don’t set to inherit from Directory.
    enter image description here

    southsouthworld Friend
    #1060725

    Thanks luna i totally forgot that K2 categories had their own display settings, I made the primary count for the k2 category "directory" to 60 and now it works! 😀

    Many many thanks for your patience and kind support!

    Kindest regards,
    Alyssa

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 10 replies, has 2 voices, and was last updated by  southsouthworld 6 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum