Year Variable

This forum is for all Flare issues not related to any of the other categories.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Year Variable

Post by lacastle »

Is it possible to create a new variable that is just the current year? Can't seem to find where MadCap sets the System Variable code.

Thanks.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Year Variable

Post by Andrew »

Sure -- just create a new variable, call it currentYear (or whatever), and enter the year. You will, of course, have to change it manually every year.
Flare v6.1 | Capture 4.0.0
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Year Variable

Post by lacastle »

Yeah, I knew I could do it that way. :( I might as well just type the year and not use a variable if I'm going to have to manually update it. I just want it on the copyright page.
Thanks.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Year Variable

Post by Andrew »

I figured that might be the case. I poked around the Flare program files trying to find out if there was any nifty little XML or other code we could hack up, but I came up empty. Looks like system variables are hard-coded into the Flare app.
Flare v6.1 | Capture 4.0.0
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Year Variable

Post by lacastle »

Thanks for trying. I couldn't find anything either. I guess I'll submit an enhancement request for customizing/creating new system variables.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Year Variable

Post by RamonS »

The question is also which year you want. The year the output was compiled in or the year the topic is viewed. Also, unless the content gets drastically changed I wonder if there is a need to adjust the copyright year.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Year Variable

Post by lacastle »

Yeah, I guess it's not that big of a deal. I just wanted to have the ability to make custom, auto-changing variables, so that's what I asked for in the enhancement.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Year Variable

Post by LTinker68 »

Are you having the copyright info appear on every page? If so, then maybe adding it to a masterpage would be easier. Wouldn't even have to be a variable -- just enter the date on the masterpage and it'll appear on every topic.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Year Variable

Post by lacastle »

No, I was trying to create a print target for my help that had a copyright page. It would have taken me 1 second to type 2008, but instead it's been a lot longer thinking about the possibilities! I never seem to like the easy way if i think there may be an easier! :)
nfberg
Propeller Head
Posts: 31
Joined: Mon Jun 09, 2008 1:01 pm
Location: Plano, TX
Contact:

Re: Year Variable

Post by nfberg »

Digging this back up from the past...

Is it yet possible to accomplish?
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Year Variable

Post by RamonS »

Is what possible to accomplish? This thread tossed several ideas around and I don't know which one you mean.
nfberg
Propeller Head
Posts: 31
Joined: Mon Jun 09, 2008 1:01 pm
Location: Plano, TX
Contact:

Re: Year Variable

Post by nfberg »

Sorry...

I should know better to be clearer in my questions...

We don't want to have to revisit the docs we provide to our clients every year to update the copyright info on the Master and would like to place a bit of code that would update annually.

All of our products are vBulletin plugins and we are able to insert a bit of code in the branding of the actual product that reads "Copyright 2008 - currentyear OurCompanyName" that automagiclly updates. We'd like to extend this into the doc set as well.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Year Variable

Post by Andrew »

I don't believe anything in Flare has changed regarding this.

However, as an idea for how to handle this, could you create the copyright stuff as a snippet, and then, using Global Project Linking, make the change every year to one snippet and have it update the text across all of your projects?
Flare v6.1 | Capture 4.0.0
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Year Variable

Post by RamonS »

The copyright year only changes when there are substantial changes to content. Unless that is the case each year you don't need to change the year each time when a handful of topics were added. There are fairly specific rules as to when the year is to be changed. I think I have them somewhere in my endless dungeon of digital documents. I may find it and if I do I share it here.

Besides that, I'd go with the masterpage way or the solution that Andrew proposed.
cbdebris
Sr. Propeller Head
Posts: 105
Joined: Wed Aug 15, 2007 4:15 pm
Location: California

Re: Year Variable

Post by cbdebris »

The issue is that many of us want a variable for <year> that applies to whatever we define. And there's no easy way to get one.

For example, in FrameMaker our <year> variable updates to the system year of the last save.

It doesnt matter what the copyright rules are -- what matters is what the boss wants and expects.
All life is a blur of Republicans and meat. -- Zippy the Pinhead
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: Year Variable

Post by peterbrown05 »

I would like a variable similar to <year> but one that is the 'build' date. Our automated build system will compile the help weekly and it would be nice for it to automatically include the date in the document. Currently we have a custom build step that creates a custom variable file for each weekly build. All automated, but not very efficient/neat.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Year Variable

Post by Andrew »

peterbrown05 wrote:I would like a variable similar to <year> but one that is the 'build' date. Our automated build system will compile the help weekly and it would be nice for it to automatically include the date in the document. Currently we have a custom build step that creates a custom variable file for each weekly build. All automated, but not very efficient/neat.
Have you looked at the "System" variable set? It contains things like ShortDate, which is the current date (while building the target). That seems like exactly what you want.
Flare v6.1 | Capture 4.0.0
NetDisplaySystems
Propeller Head
Posts: 16
Joined: Fri Nov 18, 2011 8:28 am
Location: Eindhoven, The Netherlands
Contact:

Re: Year Variable

Post by NetDisplaySystems »

Sorry to bump this topic, but if anyone is still interested in the initial problem (getting the current year automatically in your content), I've solved it by inserting a little script (javascript).
This did the trick for me:

Code: Select all

document.write((new Date()).getFullYear());
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Year Variable

Post by crdmerge »

Thanks for that!
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Re: Year Variable

Post by jasonsmith »

In the System variables set there are variables LongDate and ShortDate that contain the current year so I guess it shouldn't be that difficult to implement.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Year Variable

Post by RamonS »

But that inserts the year of the date the output was generated, which seems is not what is wanted here.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Year Variable

Post by crdmerge »

peterbrown05 on Mon Jun 21, 2010 2:56 pm said:

"I would like a variable similar to <year> but one that is the 'build' date."


Yes?
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: Year Variable

Post by peterbrown05 »

there are several solutions to similar problems here, some of which are solved previously and some more recently solved with javascript.

I used the Date variable on the front cover, ie Document Date: 23rd July 2011
but at the bottom of every webhelp page I also wanted the copyright that says "Our Company 2000-CurrYear"
the javascript trick should work for that (but havent had time to try it yet)

thanks all

p
RobinS
Propeller Head
Posts: 33
Joined: Mon Oct 22, 2012 6:27 am
Location: Scotland, UK

Re: Year Variable

Post by RobinS »

A newcomer writes: is this still not possible 'out of the box' without resorting to javascript? Like a previous poster, I just want it to pick up the year of the build date. Seems a bit basic...
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: Year Variable

Post by oceanclub »

Just bumping this 7 years later! It really would be useful if "year" was added as a system variable.

P.
Post Reply