I am currently using views with the Mailing Labels module to generate a printable pdf of labels made up of views fields. In fact, I am a genetic research scientist and I am using this to print labels for my fruit fly stocks. (I know...it sounds a little weird.)

Anyway, I want each label to include the current date when the page was loaded and the label pdf generating function was called. This is tricky because the current date has nothing to do with each node itself. I need the date that the view is being loaded.

Anyone have any ideas? I have the date module installed, but it doesn't seem to give me what I am looking for.

I guess it could be done with a views field that is filtered for php content that calls the print date() function.

Comments

dawehner’s picture

sure.

there is the global: custom field, where you can use php, i think.

waltonjones’s picture

No, I am pretty sure you can't use php with the "global:custom text" field. I think it only takes html. Any other ideas for creating a current date field for my view?

dawehner’s picture

OK. Thats true, i thought it would be possible.

But you have two possibilities:
- Theme the global: custom text, there you can use php :)
- Add a global custom field. Therefore you need to learn the views api :) As example see for example the global: counter field.

waltonjones’s picture

Sweet. Got it. Thank you!

waltonjones’s picture

Status: Active » Closed (fixed)