We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21092
    • 54 Posts
    I’ve got another tricky html/css/modx code for you to help me with...

    On my website www.katskinner.com I desire the created on (or edited if thats easier with coding, but this is less preferential) to be displayed similar to the attached image:

    I have created the html and css for this, however I am having trouble finding the appropriate calls for modx...

    The HTML I have:
    <div class="post_date">
      	<span class="day">31</span> 
      	<span class="month">July</span> 
      	<span class="year">2009</span>
    </div>


    and the CSS I have is:
    .post_date {
    	background-image: url(assets/components/KatSkinnerTheme/images/footer_bg.jpg);
     	float:left;
      	margin:10px;
      	margin-left: -30px;
      	padding:45px 8px 0;
      	position:relative;
      	color: #white;
    }
    .post_date .day {
     	font-size:52px;
      	left:5px;
      	line-height:45px;
     	position:absolute;
     	top:-10px;
    }
    .post_date .month {
     	font-size:25px;
     	text-transform:uppercase;
     	
    }
    .post_date .year {
     	-webkit-transform: rotate(-90deg);
      	-moz-transform: rotate(-90deg);
      	filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
      	display:block;
      	position:absolute;
      	right:-5px;
      	top:15px;}
    


    Can someone help me figure out the code to go in the appropriate place within HTML please (i.e. the code that will call the day, month and year seperately). I have only been able to figure out how to use the general "createdon" call...


    Thanks in advance
    Kat Skinner

      Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
      • 7455
      • 2,204 Posts
      do you use phx? (http://modxcms.com/extras/package/?package=342)
      if so than you could do it easy like this:

      <div class="post_date">
        	<span class="day">[*createdon:date=`%d`*]</span> 
        	<span class="month">[*createdon:date=`%b`*]</span> 
        	<span class="year">[*createdon:date=`%Y`*]</span>
      </div>
      
        follow me on twitter: @dimmy01
        • 21092
        • 54 Posts
        @Dimmy,

        I couldn’t follow the link as it was 404, and phx didnt come up in package manager under revolution...

        The calls did separate day, month and year perfectly, however I just need to get it to show the right date now... Any suggestions to resolve the issue of phx not showing up???
          Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I do believe that phx is built-in to Revo, so there’s nothing to install.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 21092
            • 54 Posts
            Hmmm...

            Well I did the calls you suggested below:
            <div class="post_date">
              	<span class="day">[[*createdon:date=`%d`]]</span> 
              	<span class="month">[[*createdon:date=`%b`]]</span> 
              	<span class="year">[[*createdon:date=`%Y`]]</span>
            </div>



            However it only shows up 01 for the day, Jan for month and 1970 for the year... any suggestions??
              Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
              • 7455
              • 2,204 Posts
              ok I did not know that you used revo
              somehow the createdate is not there I think thats why its giving you this date

              try using: publishedon instead

                follow me on twitter: @dimmy01
                • 7455
                • 2,204 Posts
                could you display the date unformated like [[*createdon]] to see if there is a good timestamp there
                  follow me on twitter: @dimmy01
                  • 21092
                  • 54 Posts
                  No luck sad

                  <div class="post_date">
                    	<span class="day">[[*publishedon:date=`%d`]]</span> 
                    	<span class="month">[[*publishedon:date=`%b`]]</span> 
                    	<span class="year">[[*publishedon:date=`%Y`]]</span>
                  </div> 


                  Still brings up the exact same 01, Jan, 1970 issue.

                  The straight [[*createdon]] code brings up the following "2010-06-15 21:55:31" (it does not seem to vary for any of the posts).
                  The straight [[*publishedon]] code brings up the following "2010-06-15 21:56:00" (it does not vary for any of the posts either). I double checked the published times and dates for the posts I am trying to display the date code on, and they range from the 16th to the 17th of this month with varying times.
                    Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
                    • 10487 MODX Staff
                    • 1,535 Posts
                    You’ll likely need to do:
                    [[*publishedon:strtotime:date=`%d`]]
                      Garry Nutting
                      Senior Developer
                      MODX, LLC

                      Email: [email protected]
                      Twitter: @garryn
                      Web: modx.com
                      • 7455
                      • 2,204 Posts
                      Quote from: garryn at Jun 16, 2010, 09:34 AM

                      You’ll likely need to do:
                      [[*publishedon:strtotime:date=`%d`]]


                      Jup that should do the trick evo uses timstamp where revo uses iso
                        follow me on twitter: @dimmy01