Hi,
I currently run multiple layouts, with different logos, based upon the user's URL (using Virtual Domains to set Access Levels).
My question is, is there any way of producing a PDF of an article, and including the set logo on the page? As the articles are used on multiple pages, but under different logos.
Help would be greatly appreciated!
PDF Dynamic Header
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF Dynamic Header
Hi, you can set the logo in options, but not dynamically, so this needs to be directly customized (directly for each article) in the php code
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 1
- Joined: 16 Jun 2015, 14:48
Re: PDF Dynamic Header
I have just done this ... There may be a better way but this has worked for me !
In the Content.php plugin :
round about line 40 - in the onBeforeCreatePDFContent section
add in
You will need to change [logoFile] to whatever it is in your template, the standard protostar uses [logoFile]
and then around line 117 (onBeforeDisplayPDFContent) in the section add the following:
this will now allow you to use the {phocapdflogo} tag in the header editor alongside {phocapdftitle} and {phocapdfheader}
In the Content.php plugin :
round about line 40 - in the onBeforeCreatePDFContent section
add in
Code: Select all
$content->header_logo="";
$app = JFactory::getApplication();
$tparams = $app->getTemplate(true)->params;
if ($tparams[logoFile])
{
$logo ='<img src="'.$tparams[logoFile].'" alt="" height="40" />';
}else {$logo = "";}
$content->header_logo = $logo;
and then around line 117 (onBeforeDisplayPDFContent) in the
Code: Select all
if ($content->header_data != ' ')
Code: Select all
$content->header_data = str_replace('{phocapdflogo}',$content->header_logo,$content->header_data);
-
- Phoca Newbie
- Posts: 2
- Joined: 06 Jun 2015, 00:04
Re: PDF Dynamic Header
Cheers Kiran, you should work with us on our site at some point! SCW could do with someone like you ha
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF Dynamic Header
Hi,thank you for the guide.
Jan
Jan
If you find Phoca extensions useful, please support the project