The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Feb 15, 2012 11:08 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 17, 2010 2:22 pm
Posts: 16
Hi Guys,

I am using the date format LC3 (DATE_FORMAT_LC3="d. F Y") but I want to add some more css to that, therefore I need to put the day into a <span> or a <div> element because I want to apply a different css formation than to the rest.

Does someone know how I can put single elements of the date format into a div or a span?


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 12:23 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 29, 2012 10:19 pm
Posts: 18
Location: New Zealand
Not a div, they're for blocks, spans are for inline elements.
Well, without knowing exactly where you're doing this - just wrap it with <span class="myclass"> ... </span>, then add ".myclass span {what:ever;}" to a stylesheet.


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 7:49 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 17, 2010 2:22 pm
Posts: 16
Hi,
thank you for your reply.

I wasnt very detailed while explaining the topic. Sorry for that.

I actually want to add a different css to the day, a different css to the month end so forth. But right now it is only possible to format the whole thing since the format is defined like this LC3 (DATE_FORMAT_LC3="d. F Y")


Top
 Profile  
 
PostPosted: Tue Feb 28, 2012 7:45 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 17, 2010 2:22 pm
Posts: 16
Sorry but I dont get it :/


Top
 Profile  
 
PostPosted: Tue Feb 28, 2012 11:31 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 29, 2012 10:19 pm
Posts: 18
Location: New Zealand
I'm not sure where you get this LC3 date thingy from, but if it's with PHP then say
you have a variable $date of the form "29 February 2012" -
use $date_parts = explode(" ", $date);
and then echo "<span class='d'>$date_parts[0]</span><span class='m'> $date_parts[1]</span> <span class='y'> $date_parts[2]</span>";
or instead of class just use individual style=".."

Or am I missing the point?


Top
 Profile  
 
PostPosted: Wed Oct 24, 2012 1:03 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Sep 18, 2005 1:22 pm
Posts: 158
Location: Italy
gyroglm wrote:
Or am I missing the point?

I think that was the point from ray2mi and it is for sure what I was looking for ;)

Thank you

_________________
Ant at Artimediali Web Design
Realizzazione siti web Joomla!
http://www.artimediali.net


Top
 Profile  
 
PostPosted: Wed Oct 24, 2012 5:22 pm 
Joomla! Intern
Joomla! Intern

Joined: Mon Feb 04, 2008 10:43 pm
Posts: 66
If you change this here:

Code:
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?>


Into this here:

Code:
<div class="date">
<h5 class="day"><?php echo JHtml::_('date',$this->item->created, 'd'); ?></h5><h5 class="month"><?php echo JHtml::_('date',$this->item->created, 'M'); ?></h5>
</div>


And in the css file you can use
Code:
.date{}
h5.day{}
h5.month{}


To style the day and month individually.


Top
 Profile  
 
PostPosted: Thu Oct 25, 2012 10:59 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Sep 18, 2005 1:22 pm
Posts: 158
Location: Italy
Great! This seems to be a little more elegant solution ;)

Thank you!

_________________
Ant at Artimediali Web Design
Realizzazione siti web Joomla!
http://www.artimediali.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group