Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Add changelog item for IsFirst/IsLast in elemental #631

Open
wants to merge 1 commit into
base: 5
Choose a base branch
from

Conversation

kinglozzer
Copy link
Member

@kinglozzer kinglozzer commented Nov 15, 2024

Description

Docs update for silverstripe/silverstripe-elemental#1275

Issues

silverstripe/silverstripe-elemental#1274

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no TODO comments, unrelated rewording/restructuring, or arbitrary changes)
    • Small amounts of additional changes are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • The changes follow our writing style guide
  • Code examples follow our coding conventions
  • CI is green

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference the checkbox is there for the committer (you in this case) to fill in, as a way to double check everything is ready to be reviewed.
I've ticked the boxes this time around.

@@ -72,6 +72,7 @@ The `SilverStripe\CMS\Model\SiteTree.DESCRIPTION` localisation key (along with t
## API changes

- The class names for the `TopPage` feature in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) do not follow the correct naming convention for Silverstripe CMS. The existing classes have been deprecated and will be renamed to match the correct naming convention in a future major release.
- For `BaseElement::First()` and `BaseElement::Last()` in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) have been deprecated and `IsFirst()` and `IsLast()` have been added to replace them. This is to more closely match core template loop behaviour where `$IsFirst` and `$IsLast` have been used since CMS 5. These methods are commonly used in element templates, e.g. `<% if $First %>`/`<% if $Last %>`: please update usages to `<% if $IsFirst %>`/`<% if $IsLast %>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use the same language as the other deprecations in the list.

Suggested change
- For `BaseElement::First()` and `BaseElement::Last()` in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) have been deprecated and `IsFirst()` and `IsLast()` have been added to replace them. This is to more closely match core template loop behaviour where `$IsFirst` and `$IsLast` have been used since CMS 5. These methods are commonly used in element templates, e.g. `<% if $First %>`/`<% if $Last %>`: please update usages to `<% if $IsFirst %>`/`<% if $IsLast %>`.
- [`BaseElement::First()`](api:DNADesign\Elemental\Models\BaseElement::First()) has been deprecated. Use [`BaseElement::IsFirst()`](api:DNADesign\Elemental\Models\BaseElement::IsFirst()) instead.
- [`BaseElement::Last()`](api:DNADesign\Elemental\Models\BaseElement::Last()) has been deprecated. Use [`BaseElement::IsLast()`](api:DNADesign\Elemental\Models\BaseElement::IsLast()) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants