-
AuthorPosts
-
October 8, 2011 at 10:38 am #169455
Hi! And thanks for great templates! I’ve been using a slightly wamped version of JA Purity on my site since 1.0-1.5 migration and now I’m migrating to 1.7 with JA_T3_Blank based look. Found answer to one question from earlier posts but not to this:
How do I change how the information I’ve chosen to show in article tools is displayed? More specifically I want to change the date/time format, the order of information and the category information to look more like a breadcrumb chain.
I would also like to place AddThis socal media sharing tool here but that would probably need a new module position created inside article tools or creating the whole thing with AddThis API from scratch.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 9, 2011 at 10:08 am #417874Hi,
I still don’t understand you clearly, if possible please update me with your site URL and admin account, also take some screenshots to describe your idea more then I will try to help you.
Thanks
Viet vuOctober 9, 2011 at 11:13 am #417899Well, here’s what I did:
I copied:
/plugins/system/jat3/jat3/base-themes/default/html/com_content/article/default.php
/plugins/system/jat3/jat3/base-themes/default/html/com_content/featured/default_item.php
/plugins/system/jat3/jat3/base-themes/default/html/com_content/category/blog_item.php
to:
/templates/ja_t3_blank/local/themes/user-theme/html/com_content/article/default.php
/templates/ja_t3_blank/local/themes/user-theme/html/com_content/featured/default_item.php
/templates/ja_t3_blank/local/themes/user-theme/html/com_content/category/blog_item.phpAnd change the default code (which is the same or almost the same in all of them) to:
(the first of the listed files, starting from line 78 to line 153, the changed lines)<?php if ($useDefList) : ?>
<p class="article-info">
<?php endif; ?>
<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
<span class="createdby">
<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
<?php if (!empty($this->item->contactid) && $params->get('link_author') == true): ?>
<?php
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
$item = JSite::getMenu()->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
?>
<?php echo JText::sprintf(JHtml::_('link', JRoute::_($cntlink), $author)); ?>
<?php else: ?>
<?php echo JText::sprintf($author); ?>
<?php endif; ?></span>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<span class="create">
<?php echo JText::sprintf(JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC4'))); ?>
</span>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<span class="modified">
<?php echo JText::sprintf(JHtml::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC4'))); ?>
</span>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<span class="published">
<?php echo JText::sprintf(JHtml::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC4'))); ?>
</span>
<?php endif; ?>
<?php if ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') : ?>
<span class="parent-category-name">
<?php $title = $this->escape($this->item->parent_title);
$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?>
<?php if ($params->get('link_parent_category') AND $this->item->parent_slug) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<span class="category-name">
<?php $title = $this->escape($this->item->category_title);
$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
<?php if ($params->get('link_category') AND $this->item->catslug) : ?>
<?php echo JText::sprintf($url); ?>
<?php else : ?>
<?php echo JText::sprintf($title); ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<span class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
</span>
<?php endif; ?>
<?php if ($useDefList) : ?>
</p>
<?php endif; ?>
</div>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_google_plusone"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=kankaanp"></script>
<!-- AddThis Button END -->
<?php endif; ?>Basicly I’ve:
- stripped the language dependend variables that formed the labels “Author” “Published” and so on away
- changed date/time format from DATE_FORMAT_LC2 to DATE_FORMAT_LC4 (defined in language files
- changed the order in which the information is presented
- changed it from definition list to paragraph with spans
- added a customized AddThis Button code after the article tools div is closed
This is accompanied by the choice not to show anything more than the author name and date in articles and only in the frontpage also the category of the article. I also chose to show the AddThis social media sharing buttons only in the article view so the code in present only in the article/default.php file.
This produces something looking like the attachment (esimerkki.png).Now this is what my extremely limited understanding of php code could safely accomplish. Everything can be undone by removing the file from the templates local directory but this also means that if I update the framework I’ll need to check the code side by side to update these files. I have no idea how to write the code for displaying something like “parent category” > “article category” for instance. I’m also bugged about the limited selection of date/time formats in the language file and would like to set it directly with php date/time format code if I knew how to include the code in the files. This leaves a lot to wish for but it’ll have to do for now.
AuthorPostsViewing 3 posts - 1 through 3 (of 3 total)This topic contains 3 replies, has 2 voices, and was last updated by terokankaanpera 13 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum
How do I change article tools?
Viewing 3 posts - 1 through 3 (of 3 total)