-
AuthorPosts
-
emwebmaster Friend
emwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 24, 2011 at 4:35 am #167732Hi all,
I’m trying to change the format of the date that appears in the JA Sidenews module.
I really liked how it appears in the JA Business demo:
However it appears much differently in the actual site using the JA Business template:
Using FireBug I can tell that two different sets of code are being generated for the dates.
In the demo:
<div class=”moduleItemDateCreated”>
<span class=”date”>16</span>
<span class=”month”>Feb</span>
<span class=”year”>2011</span></div>
On my live site:
<span class=”ja-createdate”>2011-08-17 – </span>I’ve isolated the file that generates this html as default.php at modules/mod_jasidenews/tmpl/ , specifically this line of code:
[PHP]<?php if (isset($item->date)) : ?>
<span class=”ja-createdate”><?php echo JHTML::_(‘date’, $item->date, JText::_(‘DATE_FORMAT_LC4’)); ?> | </span>
<?php endif; ?>[/PHP]But, not being a code-ninja I don’t know the PHP code to produce html that looks like the demo.
I’d appreciate it if anyone out there knew what the code is to produce a demo-looking date format.
Thanks,
Vince-
chavan Friend
chavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
August 24, 2011 at 5:14 am #408077please post your site admin details and ftp details I will solve it for you.
khoand Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
August 24, 2011 at 10:14 am #408123Hi,
You replace code
<span class="ja-createdate"><?php echo JHTML::_('date', $item->date, JText::_('DATE_FORMAT_LC4')); ?> | </span>
with
<span class="ja-createdate"><?php echo JHTML::_('date', $item->date, 'd-M-Y'); ?> - </span>emwebmaster Friendemwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 24, 2011 at 7:31 pm #408218Khoand:
I replaced the code as specified, but that only changed the text of the date to “22-Aug-2011”, it did not format it like the demo.
Chavan:
I will PM it to you.
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
August 24, 2011 at 8:30 pm #408230The formatting only seems to show up like that if you publish it in a menu position such as mega1
emwebmaster Friendemwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 25, 2011 at 12:34 am #408263I tried it, but still no effect. Could it be something hard-wired into the template itself, that the module then just calls upon? I did make some pretty major tweaks to the template.
khoand Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
August 25, 2011 at 5:52 am #408311Yes, because demo site use joomla 1.5, and it uses mod_k2_content. Not ja_sidenews
emwebmaster Friendemwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 25, 2011 at 9:11 am #408371I had thought, and been pretty sure, that this demo site was the 1.6 version: http://www.joomlart.com/demo/#joomla16-templates.joomlart.com/ja_business
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
August 25, 2011 at 10:41 am #408400Yes the 1.6 should have this styling but only in the mega menu. I shall drop the devs a message as I see no reason why the same styling could not be applied in the left and right positions.
khoand Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
August 25, 2011 at 12:17 pm #408431You find code from /templates/ja_business/css/mod_jasidenews.css and delete all of .ja-megamenu word
.ja-megamenu .ja-slidenews-item {
width:84%;
border-top: 1px dotted #CCCCCC !important;
border-bottom: none !important;
}.ja-megamenu .ja-slidenews-item:first-child {
border-top: none !important;
}.ja-megamenu .moduleItemDateCreated {
left: 0;
position: absolute;
top: 10px;
width: 30px;
}
.ja-megamenu .ja-slidenews-item{position:relative; padding-left: 40px !important;}.ja-megamenu .moduleItemDateCreated span.date {
color: #C3BBB6;
font-size: 200%;
font-weight: bold;
}
.ja-megamenu .moduleItemDateCreated span {
display: block;
line-height: 1;
text-align: center;
text-transform: uppercase;
}
.ja-megamenu .moduleItemDateCreated span.month {
color: #C3BBB6;
}
.ja-megamenu .moduleItemDateCreated span.year {
color: #C3BBB6;
font-size: 92%;
letter-spacing: 1px;
}
<em>@emwebmaster 262418 wrote:</em><blockquote>I had thought, and been pretty sure, that this demo site was the 1.6 version: http://www.joomlart.com/demo/#joomla16-templates.joomlart.com/ja_business</blockquote>Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
August 25, 2011 at 12:30 pm #408433Yes, thanks for the fix but we need to get it fixed for the download hence raising it with the devs. Hopefully it can be applied to the next release.
emwebmaster Friendemwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 25, 2011 at 8:47 pm #408547I did not see the mod_jasidenews.css file in that location….so I actually made one instead. And instead of deleting that code, I added it in. Now the contents within the module display with the spacing for the dates…but the dates are not generated into that spot.
I see within the default.php file (found at: mod_jasidenews/mod_jasidenews/tmpl ) starting at line 35 is the code:
[PHP]<?php if (isset($item->date)) : ?>
<span class=”ja-createdate”><?php echo JHTML::_(‘date’, $item->date, JText::_(‘DATE_FORMAT_LC4’)); ?> – </span>
<?php endif; ?>[/PHP]I believe this is the code that outputs the date HTML. However, it’s not written to use any of the classes in the css file. How would I rewrite this so each date element (month, date, year) is separate and can be formatted by the css? As seen above, it’s just some JText on a single line.
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
August 25, 2011 at 9:13 pm #408554Hi Vince,
It really is a css problem, simply moving the module position should not make the tmpl generate different code.
When your site is online (are you running online or in local?) we will be glad to take a look for you. Or you can wait for the devs to investigate and hopefully release a new version.
emwebmaster Friendemwebmaster
- Join date:
- March 2011
- Posts:
- 32
- Downloads:
- 31
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 7 times in 2 posts
August 25, 2011 at 9:59 pm #408565I think the real question is what exactly is taking that $item->date, JText::_(‘DATE_FORMAT_LC4’)) and outputting it into this:
<div class=”moduleItemDateCreated”>
<span class=”date”>16</span>
<span class=”month”>Feb</span>
<span class=”year”>2011</span></div>
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
August 25, 2011 at 10:24 pm #408566Don’t worry about that. We overide the default to create that layout in templates>ja_business>html>mod_jasidenews>default.php
Please open templates>ja_business>css>mod_jasidenews.css and replace all the code inside with the code below and it does work, I have tested on my local machine to prove it. Make sure before you do that to go into your template manager and set development mode to yes then ja and css optimization to “No”. Then clear your jat3 cache and all the joomla caches.
/*
* # ------------------------------------------------------------------------
# This is raw license
# ------------------------------------------------------------------------
# Copyright (C) 2004-20010 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# ------------------------------------------------------------------------
*/
.ja-slidenews-item {
width:84%;
border-top: 1px dotted #CCCCCC !important;
border-bottom: none !important;
}
.ja-slidenews-item:first-child {
border-top: none !important;
}
.moduleItemDateCreated {
left: 0;
position: absolute;
top: 10px;
width: 30px;
}
.ja-slidenews-item{position:relative; padding-left: 40px !important;}
.moduleItemDateCreated span.date {
color: #C3BBB6;
font-size: 200%;
font-weight: bold;
}
.moduleItemDateCreated span {
display: block;
line-height: 1;
text-align: center;
text-transform: uppercase;
}
.moduleItemDateCreated span.month {
color: #C3BBB6;
}
.moduleItemDateCreated span.year {
color: #C3BBB6;
font-size: 92%;
letter-spacing: 1px;
}
#bd .childcontent .ja-moduletable a.ja-title {
background: none repeat scroll 0 0 transparent;
border: 0 none;
box-shadow: none;
color: #6D625B !important;
font-family: Arial,Helvetica,sans-serif;
font-size: 100%;
font-weight: bold;
margin: 0 !important;
padding: 0;
text-shadow: 0 1px 0 #F4F1EF;
}
.ja-slidenews-item img {
float:left;
}
AuthorPostsThis topic contains 21 replies, has 4 voices, and was last updated by emwebmaster 13 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum