How can i call the "Article Title" via a module?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
How can i call the "Article Title" via a module?
How can i call the "Article Title" via a module?
- AMurray
- Joomla! Exemplar
- Posts: 9913
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: How can i call the "Article Title" via a module?
Exactly what do you mean by that? Please explain in further detail what you want to achieve.
Regards - A Murray
General Support Moderator
General Support Moderator
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
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>
<div class="page-header">
<h1 itemprop="headline">
ARTICLE TITLE </h1>
You do not have the required permissions to view the files attached to this post.
- AMurray
- Joomla! Exemplar
- Posts: 9913
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: How can i call the "Article Title" via a module?
Sorry, I'm still at a loss as to what you want to do; I will take a shot in the dark:
I don't know if there's any (easy) coding solution to achieve it.
- 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.
I don't know if there's any (easy) coding solution to achieve it.
Regards - A Murray
General Support Moderator
General Support Moderator
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
there is not any code that i can call the article title and display it inside a module?
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
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:
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>
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
-
- Joomla! Hero
- Posts: 2990
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: How can i call the "Article Title" via a module?
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.
- Pavel-ww
- Joomla! Ace
- Posts: 1681
- Joined: Tue Jun 30, 2020 12:17 pm
Re: How can i call the "Article Title" via a module?
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
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
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>
- Pavel-ww
- Joomla! Ace
- Posts: 1681
- Joined: Tue Jun 30, 2020 12:17 pm
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
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:
You do not have the required permissions to view the files attached to this post.
- Pavel-ww
- Joomla! Ace
- Posts: 1681
- Joined: Tue Jun 30, 2020 12:17 pm
Re: How can i call the "Article Title" via a module?
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.
-
- Joomla! Intern
- Posts: 53
- Joined: Fri Apr 05, 2024 1:13 am
Re: How can i call the "Article Title" via a module?
I get the point but the structure of the article page is only moved before the <div class="grid-child container-component">.Pavel-ww wrote: ↑Sat Apr 27, 2024 7:07 amHi.
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.
like this:
Code: Select all
<div class="page-header"><h1>..</h1>
<div class="grid-child container-component">...
Is it posible to send me a message to show you my website and that part?