Linking to "/calendar" displays the current month. I'd like to create a link from another page (or from the menus) to:

  • The current year
  • The current month (URL: /calendar )
  • The current week
  • Today

I could create such a link with PHP (not sure how to do this in a menu), but is there a shortcut whereby /calendar/thisweek would show a page with the current week, in the same way that /calendar shows the current month?

Comments

iantresman’s picture

I solved this by (a) using CSS to hide the default calendar links (using CSS Injector) (b) In my View, adding to the Header setting, PGP code that dynamically generated the appropriate links:

<div style="text-align:center">
<a href="/calendar/<?php echo date("Y") . "@">"  ?>Year</a> | 
<a href="/calendar/<?php echo date("Y") . "-" . date("m") . "@">"  ?>Month</a> |
<a href="/calendar/<?php echo date("Y") . "-W" . date("W") . "@">"  ?>Week</a> |
<a href="/calendar/<?php echo date("Y") . "-" . date("m") . "-" . date("d") . "@">"  ?>Today</a>
</div>

Where @ represents a backslash \, but the code box wouldn't show it.

iantresman’s picture

Title: Calendar: Link to "current" week or day » Calendar: Link to "current" week or day [Solved]
apaderno’s picture

Title: Calendar: Link to "current" week or day [Solved] » Calendar: Link to "current" week or day
Component: Documentation » Miscellaneous
Status: Active » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.