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

Adding missing rel attributes to URL menu item types #39275

Merged
merged 1 commit into from
Jan 22, 2023

Conversation

crystalenka
Copy link
Member

@crystalenka crystalenka commented Nov 22, 2022

Splitting this out from my other PR #39269 so that these don't get grouped with possibly breaking changes.

Summary of Changes

The URL menu item type has a field called "Link Rel Attribute".

MDN has a list of valid link types. Google also has some search-engine specific ones.

I compared these with the available options in the menu item and added missing values.

For front end links:

  • me
  • external

For back end links:

  • me
  • external
  • noopener
  • sponsored
  • ugc

While I don't expect back end menu items to be available for indexing, there might be cases where this happens intentionally (a public menu available in the admin login screen?) so it doesn't hurt to include those values as options in the admin menu item as well.

Testing Instructions

Create a new menu item type of "URL".
Go to the "Link Type" tab.
Open the "link rel attribute" dropdown.

Actual result BEFORE applying this Pull Request

Missing options.

Expected result AFTER applying this Pull Request

Options available!

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

Yes, documentation is needed because this field is missing altogether from the docs. However, after over an hour fighting with the docs site to register an account and figure out the syntax, and filling out arcane captchas, my suggested edit was blocked as spam. I will not spend more time on this because I am frustrated. If anyone else wants to try, here is what I tried to add on this page before the 'common options' heading:

<translate>
===Link Type Tab===
</translate>
<translate>
* '''Link Rel Attribute'''. The rel attribute specifies the relationship between the page you start on and the page the link directs you to. For an in-depth explanation of this attribute and what each option means, please reference the [https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel MDN Documentation].
</translate>

@ReLater
Copy link
Contributor

ReLater commented Nov 22, 2022

In terms of maintenance and usability in other extensions, wouldn't it be better to introduce a new form field in Joomla? RelAttributesField.php or something?

@crystalenka
Copy link
Member Author

And do what with the input/data/current field? Wouldn't that be a bigger b/c break?

@crystalenka
Copy link
Member Author

Not against it, just seeking to understand. :)

@crystalenka
Copy link
Member Author

Also can we keep the discussion about multiple rel attributes to the other PR? This one just adds the missing options without changing the field at all

@obuisard
Copy link
Contributor

Roland @roland-d do you want to move this one to 4.3?

@roland-d
Copy link
Contributor

@obuisard This is fine for 4.2 just needs some tests.

@Quy
Copy link
Contributor

Quy commented Jan 15, 2023

I have tested this item ✅ successfully on 17dc81c


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

1 similar comment
@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on 17dc81c


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

@Quy
Copy link
Contributor

Quy commented Jan 21, 2023

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 21, 2023
@fancyFranci fancyFranci merged commit 9b2906e into joomla:4.2-dev Jan 22, 2023
@fancyFranci fancyFranci added this to the Joomla! 4.2.7 milestone Jan 22, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 22, 2023
@fancyFranci
Copy link
Contributor

Thank you! Nice to see that the options are matching the specifications now.

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.

8 participants