Open a file when click on article
- Posted by TemplatePlazza (5260) Offline
Or you can also make condition based on module id
2 years 2 months ago #7
by TemplatePlazza
$urls = json_decode($item->urls);
if($module->id == xxx) {
$urla = $urls->urla;
}else{
$urla = $item->link;
}
The topic has been marked as resolved.
- Posted by Luca (22) Offline
thanks for both solutions
in the statement <a href="/<?php echo $urla; ?> "target =" _ blank " is it possible to open in a new window only if a URL is set or by indicating the module ID?
thanks
Luca
2 years 2 months ago #8
by Luca
in the statement <a href="/<?php echo $urla; ?> "target =" _ blank " is it possible to open in a new window only if a URL is set or by indicating the module ID?
thanks
Luca
The topic has been marked as resolved.
- Posted by TemplatePlazza (5260) Offline
Yes of course, simply add the condition :or
2 years 2 months ago #9
by TemplatePlazza
<?php if($item->urls) { ?>target ="_blank" <?php } ?>
<?php if($module->id == xxx) { ?>target ="_blank" <?php } ?>
The topic has been marked as resolved.
- Posted by Luca (22) Offline
Thanks a lot for your help.
surely I am wrong something in this command, but I hope to get the result
Thanks again
<a href="<?php echo $ scream; ?> "<? php if ($ module-> id == 132) {?> target =" _ blank "<? php}?>
2 years 2 months ago #10
by Luca
surely I am wrong something in this command, but I hope to get the result
Thanks again
<a href="<?php echo $ scream; ?> "<? php if ($ module-> id == 132) {?> target =" _ blank "<? php}?>
The topic has been marked as resolved.
- Posted by TemplatePlazza (5260) Offline
Yes that's correct.
You just missing closing mark and you don't need the trailing /
<a href="<?php echo $ scream; ?>"<? php if ($ module-> id == 132) {?> target =" _ blank "<? php}?> >
2 years 2 months ago #11
by TemplatePlazza
You just missing closing mark and you don't need the trailing /
<a href="<?php echo $ scream; ?>"<? php if ($ module-> id == 132) {?> target =" _ blank "<? php}?> >
The topic has been marked as resolved.
- Posted by Luca (22) Offline
Links are correctly opened on a new page, but this also happens for articles that do not contain links and which should be open on the same page
Luca
2 years 2 months ago #12
by Luca
$urls = json_decode($item->urls);
if($item->urls) {
$urla = $urls->urla;
}else{
$urla = $item->link;
}
......
if($default_thumbnail_mode == 0) {
// Show Thumbnail - Position before title
if(($default_thumbnail_position == "top")||($default_thumbnail_position == "left") || ($default_thumbnail_position == "right")) { ?>
<a href="<?php echo $urla; ?>" <?php if($item->urls) { ?>target ="_blank" <?php } ?> class="mfp_thumb_pos_<?php echo $default_thumbnail_position; ?>" itemprop="url"><?php echo $thumb_img[0]; ?></a>
<?php }
} ?>
Luca
The topic has been marked as resolved.