ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

HTML inside entry_date format tag

October 23, 2011 5:43pm

Subscribe [2]
  • #1 / Oct 23, 2011 5:43pm

    Tyler Herman

    39 posts

    I need to wrap span tags around each part of the entry date: month, day and year. I would rather not have to do 3 separate entry_date tags in a row to keep the queries down.

    {entry_date format="<span class='month'>%M</span><span class='day'>%d</span><span class='year'>%Y</span>"}

    is what I was thinking might work but it doesn’t seem like the quotation marks are going to fly, and I don’t know of a way in EE to escape them.

    <span class="

    is what gets displayed in the rendered template. I know you can have some symbols and characters inside the format= quotation marks.

    This isn’t life or death, just trying to better optimize my pages. It is a blog so entry_date shows up multiple times. If I have to use entry_date 3 times per post, it is going to add up pretty fast, especially on pagination pages.

    If someone has another solution I’d like to hear that as well, as long as it is a reduction in load time, which is the whole reason I’m trying this.

    Got to http://couchable.co to see what I’m doing with the entry_date if you are curious.

  • #2 / Oct 25, 2011 9:47am

    Boyink!

    5011 posts

    Did you turn on output profiling and see if adding multiple entry date tags adds queries?

    I’m thinking it won’t, since displaying the date is a different thing than querying for it.

  • #3 / Oct 25, 2011 11:05am

    Tyler Herman

    39 posts

    Thanks Mike, you are correct. I guess I should of looked before posting a question.

    Parse Date Format String Constants
    Parse Current Time Variables

    By the way, have you come across and good resources for Template Debugging and Benchmarks. Template Dubugging is pretty straightforward if you take the time to look at it but trying to figure out the DATABASE QUERIES is a little more difficult. Would you recommend just digging into basic MYSQL stuff or are there some EE specific resources out there?

  • #4 / Oct 25, 2011 11:31am

    Boyink!

    5011 posts

    Turn on Display SQL queries under Outputand Debugging prefs. EE will count them and display each one. Not in all caps though..😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases