I am using joomla 1.5 and looking out for Article Title is linkable and link goes to a pdf file. I am able to make Article Title Linkable but doesn't able to link it to a pdf file.
Is there any way to customise PDF Icon link?
Is there any way to do it? Any help appriciated.
You're probably aware that Joomla 1.5 is "End-of-Life" and no longer being maintained and presents a security issue and really should be upgraded to at least the Long Term Support 2.5 line if not the current Short Term Support 3.1 release.
In fact 1.5 is now at the point where extensions are no longer listed in the Joomla Extension Directory for it, and new 1.5 extensions are not being accepted.
You'll need to look in the PDF & Print section of the Archived Extensions Directory
Your question implies that using the standard PDF button in Joomla 1.5 isn't suitable for you either. (Don't forget that there are issues with the built-in PDF functions on older browsers.)
If you can't find a suitable extension then you will need to create a output override in your template directory for each of the content views that you want to modify. It's a trivial exercise to change the title in the article default tmpl file (i.e. com_content/views/article/tmpl/default.php) so that it's wrapped in a URL that points to the PDF version of the view.
The PDF link is simply the same as the article link except it uses the PDF format, e.g.
index.php?view=article&catid=1&id=45&format=pdf
So, if you're overriding the default output (i.e. the template you're using doesn't already have an override) you'll want the line where the page title is echo'd to change from:
<a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->article->title); ?></a>
to:
<a href="<?php echo JRoute::_('index.php?view=article&catid=' . $this->article->catid . '&id=' . $this->article->id . '&format=pdf'); ?>" class="contentpagetitle<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->article->title); ?></a>
It's worth considering that this means every article title will generate a PDF, this may confuse users. The link as it stands will also cause your websites page to be replaced with the PDF, you may want to add a target="_blank" to it so a new window/tab with the PDF is created.
Related
I recently started a new position as a graphic designer for a local nonprofit. I have a little background in HMTL and CSS, but their website runs on PHP and I'm already struggling to work with the code.
I need to add an inline frame to embed a webpage within a specific page on our website. The programmers who built our site didn’t build a user friendly interface where we can embed HTML, so I'm told that I need to add the iframe snippet into the PHP for that page. However, the page I want to edit does not have it's own PHP file. It is a subpage under one of the site's main nav categories. I was able to find a PHP file which corresponds to that main nav category that this subpage falls under. I believe that this is where I would need to add the code. It appears to be a template which structures all of the pages inside of this broader nav category.
Can anyone help me with this? I'm not sure if you can just add HTML to a PHP file as is, or if it needs to be altered a bit. Also I need to know how I could have the PHP template selectively load the desired iframe only on the page that actually needs it - I don't want that iframe to appear in all the other pages that fall within the broader nav category.
The code I need to embed looks like this:
<iframe width="100%" height="800px" src="https://google.com" frameborder="0" scrolling="yes"></iframe>
you can use html as it is on php page.
point 2: you want to show iframe on specific page only...
e.g. on page xyz.php
<?php
$basename = basename($_SERVER['PHP_SELF']); /* Returns The Current PHP File Name */
if ($basename == 'xyz.php'){ ?>
<iframe width="100%" height="800px" src="https://google.com" frameborder="0" scrolling="yes"></iframe>
<?php } ?>
I'm trying to build a module for Joomla! that I want to use as an header before the article that contains:
artile title (as h1)
a background as the article image intro
the alternative text of the intro image (as h2)
I've tryed building the module starting from the "hello world" module here and I'm editing this to my needs.
Now, I don't know how I can edit it to let it show what I need.
I've started from the background image creating this code in the default.php file without success.
<?php
// No direct access
defined('_JEXEC') or die; ?>
<div class="bg_header_article" style="background-image: url("/<?php echo htmlspecialchars($images->image_intro); ?>");"></div>
Any suggestion will be very usefull.
Thanks in advance.
Depending on the version and framework you're using, this can be accomplished out of the box.
What version of Joomla are you using?
Gantry makes this easy, as you can have many module positions over the mainbody (article) position.
I am trying to output an image assigned to an extbase entity named "course" in a fluid template. This works fine, except I just don't know how to get the correct link if an image link was defined. What I tried is this:
<f:link.page pageUid="{course.image.originalResource.link}">
<f:image image="{course.image}"/>
</f:link.page>
This works, except when I define a target in the backend this is completely ignored - is there a different way aside from f:link.page or how can I link an image?
Starting from TYPO3 7.4 you can use typolink
<f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="&u=b" additionalAttributes="{type:'button'}">
Linktext
</f:link.typolink>
I downloaded fresh yiinitializr archive (from here) unpacked it. After I configured db etc. I wanted to print a icon, just like it's mentioned at the yiistrap site:
<?php echo TbHtml::icon(TbHtml::ICON_GLASS); ?>
And it's invisible. There is a proper HTML code:
<i class="icon-glass"></i>
The bootstrap.min.js and bootstrap.min.css are also attached. Why it's still invisible?
Have you included the icon image files. Bootstrap uses the glyphicons from http://glyphicons.com/ you need to include the icons image files.
I want to generate a PDF of a webpage but apply an alternate, print-type stylesheet to it instead of the styles it uses now. Say, for example, I have a button on http://eorailway.co.uk to generate a PDF of the same page (which is run and administered by me, so therefore I can include any PHP/JS necessary to each page) but I want to apply alternate styling to it before generating the PDF.
At the moment I am using the dompdf PHP library to generate the PDF using the normal/default stylesheet, but cannot for the life of me think how to apply the alternate stylesheet to the page when clicking the "Generate PDF" button.
Any advice is most appreciated.
Since the site is under control, you could dynamically decide which stylesheets to include based on a query string parameter. i.e. http://example.com/page.php?stylesheet=print would have your template output only the alternate stylesheet, and your PDF library would fetch that page to generate.
I would recommend making an alternate page with the "print" stylesheet applied and point to it using the print meta tag. (e.g. <link rel="alternate" media="print" href="<? ECHO $_SERVER['PHP_SELF'].'?print'; ?>""> )
Then have PHP determine the stylesheet to use based on the presence of that GET variable.
You can use the DOMXML stuff in php to apply a specific XSLT file to some XML:
$stylsheet = "Example.xsl";
$xsldoc = domxml_xslt_stylesheet_file($stylsheet);
$htmldoc = $xsldoc->process($xmldoc);
$results_page = $xsldoc->result_dump_mem($htmldoc);
That's something I did in php4, might be an easier way in 5.
In the 0.6.0 release of DOMPDF you can specify the stylesheet to use by modifying the DOMPDF_DEFAULT_MEDIA_TYPE configuration constant.
http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php?r=336#234