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

[5.2] Add active class to active item in mod_ articles #44153

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

RickR2H
Copy link
Member

@RickR2H RickR2H commented Sep 29, 2024

Pull Request for Issue # .

Summary of Changes

The new mod_articles module has no active class for the active item like there was in mod_articles_category. This PR adds this functionality.

Testing Instructions

  1. Create a list of articles with the module active on all pages.
  2. Open the inspector in the browser.
  3. With the Title Only (lists) option selected, see if the link to the current article has an active class.
    image

Actual result BEFORE applying this Pull Request

No active class

Expected result AFTER applying this Pull Request

Has an active class

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@tecpromotion tecpromotion changed the title Add active class to active item in mod_ articles [5.2] Add active class to active item in mod_ articles Sep 29, 2024
@brianteeman
Copy link
Contributor

There is an active class already. Maybe its in the wrong place? I doubt we need two

<?php $attributes = ['class' => 'mod-articles-link ' . $item->active, 'itemprop' => 'url']; ?>

image

@RickR2H
Copy link
Member Author

RickR2H commented Sep 30, 2024

Agreed that with :has selector the article element now can be selected. Is a coverage of 91,66% acceptable to remove the active class on the article element? If so then I'll remove the outer class.

@RickR2H
Copy link
Member Author

RickR2H commented Oct 1, 2024

@brianteeman please test the active link for the article list.

@Quy
Copy link
Contributor

Quy commented Oct 3, 2024

I have tested this item ✅ successfully on b2494eb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44153.

@BertaOctech
Copy link

I have tested this item ✅ successfully on b2494eb

I have followed test instructions.
Active class appeared in title when the patch was applied, even with Title Only.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44153.

@Quy
Copy link
Contributor

Quy commented Oct 4, 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44153.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 4, 2024
@Hackwar Hackwar merged commit 2018b69 into joomla:5.2-dev Oct 4, 2024
2 of 3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 4, 2024
@Hackwar Hackwar added this to the Joomla! 5.2.0 milestone Oct 4, 2024
@Hackwar
Copy link
Member

Hackwar commented Oct 4, 2024

Thank you for your contribution @RickR2H

richard67 added a commit that referenced this pull request Oct 6, 2024
[5.2] Add active class to active item in mod_ articles #44153 
[5.2] Articles module: Truncate text (introtext and read more title) #44189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants