Open a file when click on article
- Posted by Luca (22) Offline
Hi, I'm back here .. with a borderline question ..
Is it possible to configure a theme so that when the user clicks on an article, a PDF file opens ?
I've read another similar post but I'm not sure it accomplishes the same thing
thank's in advance
Luca
2 years 2 months ago #1
by Luca
Is it possible to configure a theme so that when the user clicks on an article, a PDF file opens ?
I've read another similar post but I'm not sure it accomplishes the same thing
thank's in advance
Luca
The topic has been marked as resolved.
- Posted by TemplatePlazza (5260) Offline
The topic has been marked as resolved.
- Posted by Luca (22) Offline
If it were possible, I would like to be able to put in the title of the article a text that is a link to a pdf saved on the server.
alternatively, use the title of the article to show the description and insert the link to the PDF in the text of the article
or on the links page as in the attached image
thanks for your support
Luca
2 years 2 months ago #3
by Luca
alternatively, use the title of the article to show the description and insert the link to the PDF in the text of the article
or on the links page as in the attached image
thanks for your support
Luca
The topic has been marked as resolved.
- Posted by TemplatePlazza (5260) Offline
Hi, You can do that by using template override. If you don't know how to create a template override you can follow this video:
After you have created the template override, then open the override for the active minifrontpage theme, then add this line right after the foreach :
Then replace all these codes :with
2 years 2 months ago #4
by TemplatePlazza
After you have created the template override, then open the override for the active minifrontpage theme, then add this line right after the foreach :
$urls = json_decode($item->urls);
$urla = $urls->urla;
Then replace all these codes :
<?php echo $item->link; ?>
<?php echo $urla; ?>
The topic has been marked as resolved.
- Posted by Luca (22) Offline
great!!
It is exactly what I was looking for!
Two more questions:
Is it possible to open the file in a new window as a target?
With override of the default theme, I get the same behavior for all modules that point to defaut as a theme.
would it be possible to duplicate the default theme, for example in default_link in order to override the default_link theme and keep the original behavior for the default theme?
thanks
Luca
2 years 2 months ago #5
by Luca
It is exactly what I was looking for!
Two more questions:
Is it possible to open the file in a new window as a target?
With override of the default theme, I get the same behavior for all modules that point to defaut as a theme.
would it be possible to duplicate the default theme, for example in default_link in order to override the default_link theme and keep the original behavior for the default theme?
thanks
Luca
The topic has been marked as resolved.
- Posted by TemplatePlazza (5260) Offline
You just need to add target to the <a> tag right?Is it possible to open the file in a new window as a target?
<a href="<?php echo $urla; ?>" target="_blank" ..
You can make a condition, so if link A is empty it will back to the original behaviourWith override of the default theme, I get the same behavior for all modules that point to defaut as a theme.
would it be possible to duplicate the default theme, for example in default_link in order to override the default_link theme and keep the original behavior for the default theme?
thanks
Luca
$urls = json_decode($item->urls);
if($item->urls) {
$urla = $urls->urla;
}else{
$urla = $item->link;
}
The topic has been marked as resolved.