? Pending

User tests: Successful: Unsuccessful:

avatar JackKellyUK
JackKellyUK
21 Dec 2022

Pull Request for Issue #39462 .

Summary of Changes

Added article layout field to Featured Articles menu item

Testing Instructions

  1. Create Featured Articles menu item
  2. Check article layout is correct
  3. Change article layout in the menu item Options tab
  4. Check article layout switches

Actual result BEFORE applying this Pull Request

Article layout field not present

Expected result AFTER applying this Pull Request

Article layout field present

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

avatar joomla-cms-bot joomla-cms-bot - change - 21 Dec 2022
Category Front End com_content
avatar JackKellyUK JackKellyUK - open - 21 Dec 2022
avatar JackKellyUK JackKellyUK - change - 21 Dec 2022
Status New Pending
avatar JackKellyUK JackKellyUK - change - 21 Dec 2022
Title
Added article layout field to featured menu item
Added article layout field to Featured Articles menu item
avatar JackKellyUK JackKellyUK - edited - 21 Dec 2022
avatar Scrabble96
Scrabble96 - comment - 22 Dec 2022

Great! Thanks for doing this so quickly. I look forward to seeing it in 4.2.7

avatar joomdonation
joomdonation - comment - 29 Dec 2022

Could you please explain more details about the last step in testing instructions:

Check article layout switches

As I understand, this new parameter will control what layout is used to display article when users click on an article from this page to view article details. However, unlike other menu item types, we do not use Featured menu time type for routing (create links to article page), so this parameter won't be passed to article page at all. That could be the reason this parameter is not supported for this menu item type.

avatar brianteeman
brianteeman - comment - 29 Dec 2022

However, unlike other menu item types, we do not use Featured menu time type for routing (create links to article page), so this parameter won't be passed to article page at all. That could be the reason this parameter is not supported for this menu item type.

exactly correct

avatar Scrabble96
Scrabble96 - comment - 29 Dec 2022

Um. When I checked the Featured Articles menu item type (/item-type-featured-items) it gives the option to link titles, show intro text and add a 'read more' link. On the featured article page on the front end the article (featured-article-1) title is linked and the read more link is displayed in the correct place and you don't see the rest of the text unless you click the title or the read more link.... which takes you to an article page. The URL does not display as a article within its category - e.g. /category/featured-article-1 - but just as /featured-article-1. This article display uses default com_content > article > default.php layout (confirmed by adding a dummy CSS class to the first div in the file), so why can't there be an option to use another layout?

avatar joomdonation
joomdonation - comment - 29 Dec 2022

The link to article depends on how you setup menu items on your site. In your sample, if the link to article is /featured-article-1, that means you create a menu item to link directly to that article. In that case, Joomla will uses the layout which you select for that menu item

In short, the link to article has nothing related to the menu item which you created to link to featured articles menu item type, so it could not use the Article Layout setting from that said menu item, and the setting is useless.

avatar Scrabble96
Scrabble96 - comment - 29 Dec 2022

The link to article depends on how you setup menu items on your site. In your sample, if the link to article is /featured-article-1, that means you create a menu item to link directly to that article. In that case, Joomla will uses the layout which you select for that menu item

No, you misunderstood me, or more likely I didn't explain myself properly. I set up a menu item of the type "Featured Articles" and called the menu item "item-type-featured-articles". I currently have two featured articles on my test site and they both show up on the "[site]/item-type-featured-articles" page. Each article has a read more link and linked titles. The first article does not appear in a category blog elsewhere which is why, when you click the title, it just displays as [site]/featured-article-1. The second article also appears in a category blog and when clicked goes to that page, i.e. [site]/category-blog/featured-article-2.

Maybe I've completely misread your comment "However, unlike other menu item types, we do not use Featured menu time type for routing (create links to article page), so this parameter won't be passed to article page at all. That could be the reason this parameter is not supported for this menu item type." I read it to mean that clicking an article title does not take it to an article page, which it does, of course. I still don't understand why an alternative layout can't be assigned. Or does this have to be done on an article-by-article basis at article, rather than menu level?

(It also occured to me that assigning modules to a featured article menu item type will only show on the menu item and not on child articles and that, in the case of featured-article-1, the 'prev' and 'next' buttons don't work as expected, either, as they link to category blog pages or, if there aren't any, to a non-SEF link to the next article in the same category, but I guess that's another issue...).

avatar JackKellyUK
JackKellyUK - comment - 29 Dec 2022

(It also occured to me that assigning modules to a featured article menu item type will only show on the menu item and not on child articles and that, in the case of featured-article-1, the 'prev' and 'next' buttons don't work as expected, either, as they link to category blog pages or, if there aren't any, to a non-SEF link to the next article in the same category, but I guess that's another issue...).

I believe this will be related the point @joomdonation is making. The articles appear to have SEF URLs on your "item-type-featured-articles" page as they are directly linked from the menu item, but due to the way the Featured Articles menu item works the rest of Joomla can not create the same SEF URL.

The way the pages are suppose to be setup is you would have a root menu item (likely a Category Blog), then the Featured Articles is an alternative page that links to the articles within the Category Blog.

I must say that this can be confusing if you only intend to show Featured Articles on your site.

avatar joomdonation
joomdonation - comment - 29 Dec 2022

In your example, Article Layout settings belong to Featured Articles menu item settings. That setting will only be carried to article page of the link to article page is something like item-type-featured-articles/featured-article-1 or item-type-featured-articles/category/featured-article-1 (item-type-featured-articles must be active menu item for article detail page)

As you can see, due to how Joomla routing works, link to article page won't have that format, that mean when you access to an article page, the active menu item is not item-type-featured-articles, so the settings which you made for that featured articles menu item won't be used on article details page, thus article layout setting is not used. I don't know how to explain it better, it's a technical thing.

The same for modules which you assigned to item-type-featured-articles menu item. Joomla loads modules base on active menu item, and on article detail page, the item-type-featured-articles menu item is not an active menu item anymore, so modules assigned to that menu are not being loaded

So both your issues have same reasons, and unfortunately, you will have to live with it. I remember there is a PR to merge featured article menu item type into category menu item type and when that happens, the issues/confusing here will be addressed.

avatar joomdonation
joomdonation - comment - 29 Dec 2022

@JackKellyUK With the reasons explained above, I would say this PR should be closed .

avatar JackKellyUK
JackKellyUK - comment - 29 Dec 2022

@JackKellyUK With the reasons explained above, I would say this PR should be closed .

Agreed, I would be interested to see the status of the PR you mentioned

avatar brianteeman
brianteeman - comment - 29 Dec 2022

I had raised the missing router before (#37253) at tyhe time I thought it was a bug but I now understand the reasoing, logic and necessity

avatar joomdonation
joomdonation - comment - 29 Dec 2022

Agreed, I would be interested to see the status of the PR you mentioned

Sorry, the PR is #35228 , but it is for backend only.

avatar JackKellyUK
JackKellyUK - comment - 29 Dec 2022

@Scrabble96 I think if you switch your menu item to a Category Blog and in the Blog Layout set Featured Articles to Only it should solve your problem.
image

I think the Featured Articles description should be amended to reflect that fact that it is only referencing articles with an existing menu item to prevent confusion in the future.

avatar Scrabble96
Scrabble96 - comment - 29 Dec 2022

@Scrabble96 I think if you switch your menu item to a Category Blog and in the Blog Layout set Featured Articles to Only it should solve your problem.

Thanks for the suggestion, @JackKellyUK. I did try that originally, but had a problem with the display of a custom module - used as a heading - for each of the menu items. When I clicked on a featured article, it displayed the heading for the main category blog (i.e. the 'wrong' one). I still had problems when I switched to using the Featured Articles menu item type, but I got round it in the end by modifying some custom overrides, CSS and adding some JavaScript. Full description here: https://forum.joomla.org/viewtopic.php?f=811&t=998603#p3680327

avatar JackKellyUK JackKellyUK - change - 29 Dec 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-12-29 18:13:56
Closed_By JackKellyUK
Labels Added: ?
avatar JackKellyUK
JackKellyUK - comment - 29 Dec 2022

Full description here: https://forum.joomla.org/viewtopic.php?f=811&t=998603#p3680327

I'll respond on the post.

avatar JackKellyUK JackKellyUK - close - 29 Dec 2022

Add a Comment

Login with GitHub to post a comment