michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
30 stars 42 forks source link

Feature Request: coursestartdate based on course ID #251

Closed krisslaber closed 1 year ago

krisslaber commented 1 year ago

Prerequisites

Feature Request - The User Story

Basis for request: {coursename ID} and {coursesummary ID} can pull information from a different course based on course ID.

Request: Add ID to {coursestartdate}

Use Case: Marketing other courses on a similar course page; posting course time in description. Course pages with schedule in label. This option would be valuable with learner bases in multiple time zones.

Screenshots / Mock-ups

No response

Alterative you have considered

My SQL commands Every variation of current {coursestartdate} Nesting {Coursestartdate} with {Coursename ID} in different configuations.

Additional information

No response

Planning on submitting a solution in a pull request (PR)?

No

Code of Conduct

michael-milette commented 1 year ago

Hi @krisslaber,

Thank you for the suggestion. The {coursestartdate} tag can now have an optional course id parameter. Note that if you specify both the date/time format and course id parameter, the id parameter must appear after the date/time format, not before.

A few examples of valid syntax:

This is invalid:

Please note that this feature is currently only included with the version of FilterCodes available here on GitHub. If you would be so kind, I would be really thankful if you would be so kind as to try it out and let me know if works for you.

Best regards,

Michael Milette

krisslaber commented 1 year ago

It works perfectly inside any course page. I can retrieve the start date for a different course page and it displays as expected. The start date does not display outside of a course page such as on the home page or in the course description. It continues to display "Not yet started."

In course description [image: image.png] On course page [image: image.png]

On Thu, May 18, 2023 at 5:22 PM Michael Milette @.***> wrote:

Hi @krisslaber https://github.com/krisslaber,

Thank you for the suggestion. The {coursestartdate} tag can now have an optional course id parameter. Note that if you specify both the date/time format and course id parameter, the id parameter must appear after the date/time format, not before.

A few examples of valid syntax:

  • {coursestartdate}
  • {coursestartdate 3}
  • {coursestartdate strftimedate}
  • {coursestartdate strftimedate 3}
  • {coursestartdate strftimedate 9999} --> will result in 31 December 1969 if the course id does not exist.

This is invalid:

  • {coursestartdate 3 strftimedate}

Please note that this feature is currently only included with the version of FilterCodes available here on GitHub. If you would be so kind, I would be really thankful if you would be so kind as to try it out and let me know if works for you.

Best regards,

Michael Milette

— Reply to this email directly, view it on GitHub https://github.com/michael-milette/moodle-filter_filtercodes/issues/251#issuecomment-1553662123, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5OKRDMF7E5VXAVCFPJ5WR3XG2HJTANCNFSM6AAAAAAUFTVRSY . You are receiving this because you were mentioned.Message ID: @.*** com>

michael-milette commented 1 year ago

Hi @krisslaber ,

Thank you for testing and reporting the new issue. Unfortunately, your images did not come through however, I was able to reproduce the issue and found a few lines of old code that I forgot to remove. Should be all good now. Could you please try it again with the latest version here on GitHub?

Best regards,

Michael

krisslaber commented 1 year ago

Perfection! We have a world-wide learner base and this functionality is a game-changer. Thank you so much for taking the time to update your wonderful plugin!

michael-milette commented 1 year ago

Hi @krisslaber ,

Thank you for testing it again. Glad to hear that it is working for you.

Best regards,

Michael