The Thinkery

Not finding what you're looking for? Don't hesitate to contact us!

Before Posting...

Before posting questions in the forums, please be sure to read the FAQs by clicking on the FAQs link in the sidebar product menu. You must be logged in and have a valid subscription to access the SUPPORT FORUMS.
×
Support Policy Notice

As outlined in our Rules section (though never closely followed by our staff!), effective immediately we will no longer be taking time to provide customizations of our products.

Date & Status on Category List

  • ninjanody
  • ninjanody's Avatar Topic Author
  • Offline
  • Puzzler
  • Puzzler
More
6 years 3 months ago - 6 years 3 months ago #45596 by ninjanody
ninjanody replied the topic: Date & Status on Category List
I have managed to display the fields i like on the frontend by some code tweaking.

Steps:
Create template override for com_projectlog -> category
Backup file/components/com_projectlog/views/category/tmpl/default.xml and add the following to the end of the <fields> group.
<!-- Custom options. -->
		<fieldset name="custom" label="JGLOBAL_CUSTOM_LABEL" description="COM_PROJECTLOG_CONFIG_CUSTOM_SETTINGS_DESC">
			<field name="show_project_date"
                type="list"
				class="chzn-color"
                label="COM_PROJECTLOG_DATE_LABEL" 
                description="COM_PROJECTLOG_FIELD_DATE_FORMAT_DESC"
                >         
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
            </field>
 
			<field name="show_project_status"
                type="list"
				class="chzn-color"
                label="COM_PROJECTLOG_STATUS_LABEL" 
                description="COM_PROJECTLOG_FIELD_STATUS_DESC"
                >         
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
            </field>
 
			<field name="show_contract_from"
                type="list"
				class="chzn-color"
                label="COM_PROJECTLOG_CONTRACT_FROM_DATE_LABEL" 
                description="COM_PROJECTLOG_FIELD_CONTRACT_FROM_DATE_DESC"
                >         
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
            </field>
        </fieldset>

Open file /templates/yourtemplate/html/com_projectlog/category/default_items.php and add the following after line 77.
<?php if ($this->params->get('show_contract_from')) : ?>
                        <th><?php echo JHtml::_('grid.sort', 'COM_PROJECTLOG_CONTRACT_FROM_DATE', 'contract_from', $listDirn, $listOrder); ?></th>
                    <?php endif; ?>
					<?php if ($this->params->get('show_project_status')) : ?>
                        <th><?php echo JHtml::_('grid.sort', 'COM_PROJECTLOG_STATUS_LABEL', 'status', $listDirn, $listOrder); ?></th>
                    <?php endif; ?>
					<?php if ($this->params->get('show_release_date')) : ?>
                        <th><?php echo JHtml::_('grid.sort', 'COM_PROJECTLOG_COMPLETE_DATE', 'release_date', $listDirn, $listOrder); ?></th>
                    <?php endif; ?>

Open file /templates/yourtemplate/html/com_projectlog/category/default_items.php and add the following after line 132.
                        <?php if ($this->params->get('show_contract_from') AND !empty($item->contract_from)) : ?>
                            <td><?php echo JHTML::date($item->contract_from, $item->params->get('pl_date_format')); ?></td>
						<?php endif; ?>
<?php if ($this->params->get('show_project_status')) : ?>
                            <td><?php echo ($item->params->get('show_project_status') AND !empty($item->status)) ? $item->status : '--'; ?></td>
						<?php endif; ?>
 
						<?php if ($this->params->get('show_release_date')) : ?>
                            <td><?php echo JHTML::date($item->release_date, $item->params->get('pl_date_format')); ?></td>
						<?php endif; ?>	

Now you will have an output and menu config option like the included screenshots exept the translation. I have change some of the field translation based on my needs.
Attachments:
Last Edit: 6 years 3 months ago by ninjanody.

Please Log in or Create an account to join the conversation.

  • ninjanody
  • ninjanody's Avatar Topic Author
  • Offline
  • Puzzler
  • Puzzler
More
6 years 3 months ago #45598 by ninjanody
ninjanody replied the topic: Date & Status on Category List
Maybe there is better approach & may errors occur fron the code above. Maybe the moderators or developers provide a cleaner solution..

Please Log in or Create an account to join the conversation.

Moderators: vinny
Time to create page: 0.785 seconds