Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • emwebmaster Friend
    #167732

    Hi 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


    1. demo
    2. site
    chavan Friend
    #408077

    please post your site admin details and ftp details I will solve it for you.

    khoand Friend
    #408123

    Hi,
    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 Friend
    #408218

    Khoand:

    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 Moderator
    #408230

    The formatting only seems to show up like that if you publish it in a menu position such as mega1

    emwebmaster Friend
    #408263

    I 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 Friend
    #408311

    Yes, because demo site use joomla 1.5, and it uses mod_k2_content. Not ja_sidenews

    emwebmaster Friend
    #408371

    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

    Phill Moderator
    #408400

    Yes 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 Friend
    #408431

    You 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 Moderator
    #408433

    Yes, 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 Friend
    #408547

    I 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.


    1. sidenews
    Phill Moderator
    #408554

    Hi 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 Friend
    #408565

    I 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 Moderator
    #408566

    Don’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;
    }

Viewing 15 posts - 1 through 15 (of 21 total)

This 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