In file components/com_content/tmpl/article/default.php:
$urls
gets defined here: https://github.com/joomla/joomla-cms/blob/4.0.0-beta7/components/com_content/tmpl/article/default.php#L25above
article text or not: https://github.com/joomla/joomla-cms/blob/4.0.0-beta7/components/com_content/tmpl/article/default.php#L89-L92<?php
if (isset($urls)
&& ((!empty($urls->urls_position) && ($urls->urls_position == '0'))
|| ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
isset($urls)
is ALWAYS true because we've defined it in line 25. It can be empty(...)
if links and images aren't displayed in edit views. But default_links.php
checks this already in a reliable way: https://github.com/joomla/joomla-cms/blob/4.0.0-beta7/components/com_content/tmpl/article/default_links.php#L19 .$urls->urls_position
. What is that? I couldn't find any place in core where this variable gets defined.$urls
object looks like this (or empty()
):stdClass Object
(
[urla] => /leistungen/dach
[urlatext] => wqwewqqw
[targeta] =>
[urlb] =>
[urlbtext] =>
[targetb] =>
[urlc] =>
[urlctext] =>
[targetc] =>
)
$params->get('urls_position')
.Labels |
Added:
?
|
As much as I see this is since 8 years and apparently nobody used it.
May I say something here?
If this is the code that exists in the J3 then it's safe to say that the option for rendering the urls to the top or the bottom was never used by NOBODY the last 8 years!!!
Just remove it. Same can be said for many other options...
It was used (e.g. by me) but the fun is that the result is the same if we would just use
if ((int) $params->get('urls_position') === 0)
I stumbled over these lines 1000 times in the last years whenever I created an override and just wondered that they are still there in Joomla 4 ;-)
But in principle you are right. I would replace it with a setting "Display links: Yes/No" and display them below by default. Then there are 3 understandable lines of code that can be easily moved in an override if somebody wants the links above.
Aaaaaah: #9491 (comment)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-17 13:04:31 |
Closed_By | ⇒ | ReLater |
@ReLater You read the code correctly. There are something wrong with the code exactly as you described, so please make a PR to correct it.