Open a file when click on article

  • Posted by TemplatePlazza (4837) Offline
Or you can also make condition based on module id
$urls = json_decode($item->urls);
if($module->id == xxx) {
    $urla = $urls->urla;
}else{
    $urla = $item->link;
}
3 months 3 weeks ago #7 by TemplatePlazza
The topic has been locked.
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
3 months 3 weeks ago #8 by Luca
The topic has been locked.
  • Posted by TemplatePlazza (4837) Offline
Yes of course, simply add the condition :
<?php if($item->urls) { ?>target ="_blank" <?php } ?>
or
<?php if($module->id == xxx) { ?>target ="_blank" <?php } ?>
3 months 3 weeks ago #9 by TemplatePlazza
The topic has been locked.
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}?>
3 months 3 weeks ago #10 by Luca
The topic has been locked.
  • Posted by TemplatePlazza (4837) 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}?> >
3 months 3 weeks ago #11 by TemplatePlazza
The topic has been locked.
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
$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
3 months 3 weeks ago #12 by Luca
The topic has been locked.
Powered by Kunena Forum