Open Forum

 View Only
  • 1.  Data Tag for the Current Year

    Posted 01-18-2024 09:51
    Edited by Kameron Kidd 01-18-2024 14:05

    Hello! I'm working on a project in which I need to include the current year (not the date of the event). A data tag would be ideal since my solution needs to be in text, but I can't seem to find one or a way to make one. How would I go about this?


    #ManagingEvents
    #Miscellaneous

    ------------------------------
    Baylee DeVos
    ------------------------------



  • 2.  RE: Data Tag for the Current Year

    Posted 01-18-2024 10:37

    Baylee,

    If you have access to Custom Data Tags. Admin > General > Custom Data Tags you should be able to create your own. 

    We use a custom data tag for our current year as well.

    Name: Copyright Year
    Type: Content Block
    Code: COPYRIGHTYEAR
    Tag: {[A-CUSTOM TAG:COPYRIGHTYEAR]}
    HTML: <script type="text/javascript">document.write(new Date().getFullYear())</script>

    Hope that helps


    ------------------------------
    James Rose | Senior Web Developer and Platform/Product Manager
    Digital Infrastructure
    Office of University Development | University of Michigan
    ------------------------------



  • 3.  RE: Data Tag for the Current Year

    Posted 01-18-2024 13:38

    Hi James,

    Does there need to be anything in the plain text field? I made the tag but unfortunately when I put it on the event website, it shows up as empty.

    Thanks for your insight on this!



    ------------------------------
    Baylee DeVos
    ------------------------------



  • 4.  RE: Data Tag for the Current Year
    Best Answer

    Posted 01-18-2024 14:12

    Probably the best advice is to use the code widget and just drop the code into it: <script type="text/javascript">document.write(new Date().getFullYear())</script> especially with JavaScript.

    I think the custom widget doesn't like JavaScript






    ------------------------------
    James Rose | Senior Web Developer and Platform/Product Manager
    Digital Infrastructure
    Office of University Development | University of Michigan
    ------------------------------



  • 5.  RE: Data Tag for the Current Year

    Posted 01-18-2024 15:31

    Thanks so much, worked like a charm!



    ------------------------------
    Baylee DeVos
    ------------------------------