- Posts: 40
- Thank you received: 0
Making these displayed images link to the articles
-
kent8
Active member - Topic Author
- Member
Less
More
2 years 4 months ago #49422
by kent8
Making these displayed images link to the articles was created by kent8
On this page:
recreation.townoflimon.com/index.php/youth-sports
The sports activities are displayed using the Newsflash type module.
The titles are linked to the respective articles.
The client has asked that I make the images link to the articles as well.
The module settings does not provide for this.
Can you please tell me how to make the images link to the articles in this Newsflash display module?
Thank you
Kent
recreation.townoflimon.com/index.php/youth-sports
The sports activities are displayed using the Newsflash type module.
The titles are linked to the respective articles.
The client has asked that I make the images link to the articles as well.
The module settings does not provide for this.
Can you please tell me how to make the images link to the articles in this Newsflash display module?
Thank you
Kent
Please Log in to join the conversation.
-
milos
Support Staff - Moderator
Less
More
- Posts: 6742
- Thank you received: 715
2 years 4 months ago - 2 years 4 months ago #49430
by milos
Replied by milos on topic Making these displayed images link to the articles
Hello,
You must create a newsflash module override. I guess you are using the module "mod_articles_news". You should copy this file:
/modules/mod_articles_news/tmpl/_item.php
to this folder (create the folder)
/templates/fitness/html/mod_articles_news/_item.php
Then open the copied file and change this part:
to this:
If it doesn't work you probably missed the file or the folder or the module. More details about module override here: docs.joomla.org/Understanding_Output_Overrides (read the section Module Layout Overrides).
Regards,
Milos
You must create a newsflash module override. I guess you are using the module "mod_articles_news". You should copy this file:
/modules/mod_articles_news/tmpl/_item.php
to this folder (create the folder)
/templates/fitness/html/mod_articles_news/_item.php
Then open the copied file and change this part:
Code:
<figure class="newsflash-image">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->imageSrc,
'alt' => $item->imageAlt,
]
); ?>
<?php if (!empty($item->imageCaption)) : ?>
<figcaption>
<?php echo $item->imageCaption; ?>
</figcaption>
<?php endif; ?>
</figure>
to this:
Code:
<figure class="newsflash-image">
<a href="<?php echo $item->link; ?>">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->imageSrc,
'alt' => $item->imageAlt,
]
); ?>
</a>
<?php if (!empty($item->imageCaption)) : ?>
<figcaption>
<?php echo $item->imageCaption; ?>
</figcaption>
<?php endif; ?>
</figure>
If it doesn't work you probably missed the file or the folder or the module. More details about module override here: docs.joomla.org/Understanding_Output_Overrides (read the section Module Layout Overrides).
Regards,
Milos
Last edit: 2 years 4 months ago by milos.
The following user(s) said Thank You: kent8
Please Log in to join the conversation.
Time to create page: 0.222 seconds