Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • mohammadzaher Friend
    #928319

    I would like to use JA Healthcare and purchase JA k2 filter component for creating a jobs-link-sharing website, now before that i had three questions i hope i can have a good solution suggested:

    1. How to create a category-list for K2 categories just like the category-list JA Healthcare has under Joomla Pages menu >> Category List submenu for Joomla articles? Because i would like to create a job listing website to list all the recent jobs (which are added so far as K2 items) and mentioned at least Job-Title, Job-Location, Employer-Name, Job-Expiration-Date (that are 4 K2 Extra fields) in the list related to any job. As a sample look at Picture-1 attached file.

    2. How to just show 4 of K 2 Extra Fields in category-listing view while i have 10 Extra Fields in each item in K2?

    3. I am bale to show/hide start publishing and modify publishing dates of a K2 item but i would like to show/hide the item’s finish publishing date as well, to show an item’s expiration date in the front it. How to do this?

    I hope i can have a better solution or suggestion. Thanks in advance for your support.


    1. Picture-1
    Luna Garden Moderator
    #929313

    Hi,

    1. How to create a category-list for K2 categories just like the category-list JA Healthcare has under Joomla Pages menu >> Category List submenu for Joomla articles?

    K2 doesn’t have the style for this Layout, if you want it for your site, you will need to do a bit of custom work and change setting to hide Read more text and Image of item.

    1. How to just show 4 of K 2 Extra Fields in category-listing view while i have 10 Extra Fields in each item in K2?

    Go to file:

    ja_healthcare\html\com_k2\doctors\category_item.php

    Find

    <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>
          <!-- Item extra fields -->
          <div class="catItemExtraFields">
            <ul>
                <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
                <?php if($extraField->value != ''): ?>
                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
                    <?php if($extraField->type == 'header'): ?>
                    <h4 class="catItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
                    <?php else: ?>
                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                    <?php endif; ?>
                </li>
                <?php endif; ?>
                <?php endforeach; ?>
                </ul>
            <div class="clr"></div>
          </div>
          <?php endif; ?>

    Change code:

    <?php else: ?>
                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                    <?php endif; ?>

    to

    <?php else: ?>
    <?php if($extraField->alias!='alias of extra field you want to eliminate'):?>
        <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
    <?php endif; ?>
    <?php endif; ?>
    1. I am bale to show/hide start publishing and modify publishing dates of a K2 item but i would like to show/hide the item’s finish publishing date as well, to show an item’s expiration date in the front it. How to do this?

    In order to show item’s expiration date , go to the file

    ja_healthcare\html\com_k2\doctors\category_item.php

    find

    <div class="catItemHeader">
            <?php if($this->item->params->get('catItemDateCreated')): ?>
            <!-- Date created -->
            <span class="catItemDateCreated">
                <?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
            </span>
            <?php endif; ?>

    add code

    <div class="catItemHeader">
        <!-- Date created -->
        <span class="catItemDateCreated">
            <?php echo JHTML::_('date', $this->item->publish_down , JText::_('K2_DATE_FORMAT_LC2')); ?>
        </span>

    mohammadzaher Friend
    #929866

    In order to show item’s expiration date , go to the file

    finish-publishing-date showed but there is an issue, when the finish-publishing-date cell is empty at the back end it still shows a default date "Mondy, 30 November -0001 00:00" for each item at the front end. The reason I think is that we do not have an if statement like the one we have with created-date parameter showing at your code above, but now when i want to create an if statement for publish-down parameter i don’t know what parameter should i get or call inside the if statement?

    And as you can look at the attached file, three is two red circles , showing that you have the option to either show or hide, the created-date and the modified-date of an item from the back end, now here i would like the finish publishing date option to be added as well, so that i can manage either to show or hide the finish publishing date of an item .


    1. HC
    Luna Garden Moderator
    #930198

    Hi,

    If you want to add the finish publishing date option, I afraid you have to add it yourself or ask the developer of K2 help you to add it.

    I only help you how to show the the finish publishing date on front-end, the code I suggest is different, I change $this->item->created to $this->item->publish_down

    mohammadzaher Friend
    #930348

    I only help you how to show the the finish publishing date on front-end, the code I suggest is different, I change $this->item->created to $this->item->publish_down

    Okay, but what about that default value ‘Mondy, 30 November -0001 00:00‘ showing up even their is no finish publishing date set to an item. When there is no publishing date set to an item it should not show any date, right?

    I mean for created date there is an if code line <?php if($this->item->params->get('catItemDateCreated')): ?> to check if there is a created date through the ‘catItemDateCreated‘ parameter, what parameter should i use to check if the finish publishing date for an item is available to be showed out.

    Luna Garden Moderator
    #930924

    Hi,
    Just change the code I suggest you to this:

        <div class="catItemHeader">
                <?php if($this->item->publish_down != '0000-00-00 00:00:00'): ?>
                <!-- Date created -->
                <span class="catItemDateCreated">
                    <?php echo JHTML::_('date', $this->item->publish_down , JText::_('K2_DATE_FORMAT_LC2')); ?>
                </span>
                <?php endif; ?>

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

This topic contains 5 replies, has 2 voices, and was last updated by  Luna Garden 8 years, 6 months ago.

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