Page 1 of 1

How can i call the "Article Title" via a module?

Posted: Thu Apr 18, 2024 4:17 pm
by joomlerGR
How can i call the "Article Title" via a module?

Re: How can i call the "Article Title" via a module?

Posted: Thu Apr 18, 2024 10:02 pm
by AMurray
Exactly what do you mean by that? Please explain in further detail what you want to achieve.

Re: How can i call the "Article Title" via a module?

Posted: Sat Apr 20, 2024 7:57 pm
by joomlerGR
i want to display-call the current article title via module at the "banner" position because i will hide the current one:
<div class="page-header">
<h1 itemprop="headline">
ARTICLE TITLE </h1>

Re: How can i call the "Article Title" via a module?

Posted: Sat Apr 20, 2024 9:27 pm
by AMurray
Sorry, I'm still at a loss as to what you want to do; I will take a shot in the dark:
  • Create a custom module
  • Name the module after the article title. The module content will also show the text that is the article's title.
  • Assign that module to that one article (or menu item), in the banner position.
This is a manual work-around and I don't know if the above is how you can achieve what you want, but try it out. The article title is tied to the article, you can't move it to a module. You can (in the article options) not show the article title) and so you can have a separate module showing it. This would be no different than creating a banner/slideshow that you place in the banner module position on certain pages, except in your case, you want to do so for specific pages. It may not be a long-term solution if you have to do this with every article you have.

I don't know if there's any (easy) coding solution to achieve it.

Re: How can i call the "Article Title" via a module?

Posted: Sat Apr 20, 2024 9:40 pm
by joomlerGR
there is not any code that i can call the article title and display it inside a module?

Re: How can i call the "Article Title" via a module?

Posted: Sat Apr 20, 2024 9:47 pm
by joomlerGR
on my old joomla website i was using the following code
inside the default.php to call-display the article title in other position of the page:

Code: Select all

        <h1 itemprop="nameer" style="font-size: 17px;letter-spacing: -0.4px;padding-top: 10px;padding-bottom: 8px;width: 848px;float: none;">
        <?php if ($params->get('show_title')) : ?>
		<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
		<?php echo $this->escape($this->item->title); ?>
		<?php else : ?>
		<?php echo $this->escape($this->item->title); ?>
		<?php endif; ?>
		<?php endif; ?></h1> 

Re: How can i call the "Article Title" via a module?

Posted: Wed Apr 24, 2024 9:37 pm
by joomlerGR
ANY UPDATE?

Re: How can i call the "Article Title" via a module?

Posted: Thu Apr 25, 2024 6:13 am
by SharkyKZ
A similar question was asked on JSE https://joomla.stackexchange.com/a/33777/12652. If you need specifically article title, you'll need to query the article model or the database.

Re: How can i call the "Article Title" via a module?

Posted: Thu Apr 25, 2024 8:53 am
by Pavel-ww
joomlerGR wrote: Sat Apr 20, 2024 7:57 pm i want to display-call the current article title via module at the "banner" position because i will hide the current one:
<div class="page-header">
<h1 itemprop="headline">
ARTICLE TITLE </h1>
Hi. This will be a big mistake in the point of view of SEO. Perhaps you just need to use CSS to make the appearance as you want, but not to create Frankenstein hiding the structured H1

Re: How can i call the "Article Title" via a module?

Posted: Thu Apr 25, 2024 5:17 pm
by joomlerGR
if i will use the following js to reposition the title i will have problems with SEO?

Code: Select all

<script defer>
    const pageHeaderElement = document.querySelector('.view-article .page-header');
    const modDatetimeElement = document.querySelector('.mod_datetime.mod_datetime_96');
    const parentElement = modDatetimeElement.parentNode;
    parentElement.insertBefore(pageHeaderElement, modDatetimeElement.nextSibling);
</script>

Re: How can i call the "Article Title" via a module?

Posted: Fri Apr 26, 2024 6:55 am
by Pavel-ww
joomlerGR wrote: Thu Apr 25, 2024 5:17 pm if i will use the following js to reposition the title i will have problems with SEO?
It doesn't matter which js you are using. Only the final HTML marking matters.

Re: How can i call the "Article Title" via a module?

Posted: Fri Apr 26, 2024 1:34 pm
by joomlerGR
after i have the JS enabled and the article .page-header' <H1> position is changed to be shown before the <site-grid> when i use online tools to check the <H1> tag checker i get that result:

Re: How can i call the "Article Title" via a module?

Posted: Sat Apr 27, 2024 7:07 am
by Pavel-ww
joomlerGR wrote: Fri Apr 26, 2024 1:34 pm when i use online tools to check the <H1> tag checker i get that result:
Hi.

Online Tools checks the existence of H1, but does not check the correctness of its location in the aspect of the page semantic.

Imagine a book page with a text and heading. What you did - erased the heading from the page and wrote it on a separate sheet of paper.

Now the general elements of the site, such as breadcrumbs, sidebar, footer and others will be regarded by search engines as part of a specific page, which will cause warnings about duplication of content, too many keywords on the page and so on.

Therefore, your solution can be justified for a separate page such as Landing Page where you do not have common site's elements below H1. But not for all article page types.

I hope now you understand. But in any case, you decide. I do not insist, but just gave advice.

Re: How can i call the "Article Title" via a module?

Posted: Sun Apr 28, 2024 10:52 pm
by joomlerGR
Pavel-ww wrote: Sat Apr 27, 2024 7:07 am
joomlerGR wrote: Fri Apr 26, 2024 1:34 pm when i use online tools to check the <H1> tag checker i get that result:
Hi.

Online Tools checks the existence of H1, but does not check the correctness of its location in the aspect of the page semantic.

Imagine a book page with a text and heading. What you did - erased the heading from the page and wrote it on a separate sheet of paper.

Now the general elements of the site, such as breadcrumbs, sidebar, footer and others will be regarded by search engines as part of a specific page, which will cause warnings about duplication of content, too many keywords on the page and so on.

Therefore, your solution can be justified for a separate page such as Landing Page where you do not have common site's elements below H1. But not for all article page types.

I hope now you understand. But in any case, you decide. I do not insist, but just gave advice.
I get the point but the structure of the article page is only moved before the <div class="grid-child container-component">.

like this:

Code: Select all

<div class="page-header"><h1>..</h1>
<div class="grid-child container-component">...
Eve that a problem for SEO;

Is it posible to send me a message to show you my website and that part?