this is such a simple task, yet I can't seem to get it to load a pdf.
I have a simple link on my view that links to a pdf stored in a downloads folder.
Is there something I'm missing about doing this in CodeIgniter?
<div class="node_title_grant">
<a href="<?php echo base_url();?>index.php/downloads/grant.pdf" target="_blank">
Grant
</a>
</div>
then I have grant.pdf stored in a downloads folder in my application folder.
thanks in advance
Simply do the normal path ...
href="<?php echo base_url(); ?>application/downloads/grant.pdf"
Or:
href="/application/downloads/grant.pdf"
Edit:
I believe .htaccess was the problem. Moving the downloads folder from inside applications to the root directory solved the issue.
You want to use the anchor function here:
<div class="node_title_grant">
<?php echo anchor('downloads/grant.pdf', 'Grant', 'target="_blank"); ?>
</div>
Or, you can pass the filename to base_url:
<div class="node_title_grant">
<a href="<?php echo base_url('downloads/grant.pdf');?>" target="_blank">
Grant
</a>
</div>
Related
For some reason unknown to me when I try to use a .svg file in the image src path cakephp adds an additional / to the file path which shows the image as missing.
example:
<img src="<?php e($html->url('/img/mobile/shark.svg')); ?>"
outputs:
<img src="host/img/mobile/shark.svg/"
It then thinks the file is not there. But when I remove the / in chrome inspect the file appears. Anyone see this issue before?
Update 5/1
On Cake 1.3, and beyond our control at the moment to update. These helpers just break the page =( and after looking at the documentation for 1.3 it looks like it should not.
Create a image tag using cakephp helper,
<?php echo $this->Html->image('example.svg', array('alt' => 'CakePHP')); ?>
Output will be
<img src="/img/example.svg" alt="CakePHP" />
Look HtmlHelper::image(string $path, array $options = array())
You should use the CakePhp HTML helper.
<?php echo $this->Html->image('image.svg', array('alt' => 'image')) ?>
I have the following problem.
My category description above (before the goods).
I wish to change the location of the category description. This should be at the bottom (after the goods).
I am using magento commerce 1.9
You need to find the category template, which should be in your theme directory here;
app/design/frontend/XXX/YYY/template/catalog/category/view.phtml
Where XXX YYY is the directory of the template you are using. If there is no view.phtml file in there, magento will fall back to the base version here;
app/design/frontend/base/default/template/catalog/category/view.phtml
I suggest you copy it to your theme directory if it wasnt there.
Now, open that file and find this;
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>
And simply move it to the end of the file.
I have created a basic template for Joomla using Foundation 5 Framework but the call to include Foundation and jQuery and the call to fire Foundation needs to be the last part that is loaded.
<script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/bower_components/foundation/js/foundation.min.js"></script>
<script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/bower_components/jquery/jquery.js"></script>
<script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/app.js"></script>
So I have added them into the template and they can be navigated to when I load the template up but for some reason foundation does not exist according to firebug and won't load.
If Firebug is saying that the file does not exist then you have used the incorrect path. As for the importing of jQuery, I would recommend you use the Joomla standards for this which will also import the file that comes package use noConflict() mode like so >> JHtml::_('jquery.framework');
Also try using the addScript() method for importing your other scripts, however please ensure that the paths are correct. So your full code will look like this:
<?php
JHtml::_('jquery.framework');
JHtml::_('script', JUri::root() . 'templates/template_name/bower_components/foundation/js/foundation.min.js');
JHtml::_('script', JUri::root() . 'templates/template_name/js/app.js');
?>
Currently, your .js files are within the template folder, however are within different sub-folders, thus I would recommend sticking to 1 main folder for all javascript files.
Update:
I have just tested Foundations and it works fine for me. First of all, you need to ensure that jQuery is loaded first. Add the following code before the ending ` tag in your template index.php file:
<script src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/bower_components/jquery/jquery.js"></script>
<script src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/bower_components/foundation/js/foundation.min.js"></script>
<script> $(document).foundation(); </script>
Hope this helps
I am upload the image into database and folder. But when I am trying to retrieve it it will not working.
My code is as below:
<img src="<?php echo APPPATH.'modules/employee/image/'.#$userdata[0]->photo;?>" />
Give me a solution.
Try:
<img src="<?php echo base_url().'modules/employee/image/'.#$userdata[0]->photo;?>" />
Constant APPPATH will not give you full path, you must need to use base_url() instead, but for using base_url() you also need to define your base_url in config.php
I'm trying to achieve the following:
our client needs the header logo of his magento site to take him to another website (different domain).. I have tried to alter header.phtml but the link is becoming: www.websitedomain.com/index.php/www.otherdomain.com
what I want is simply to navigate to www.otherdomain.com
how is that possible?
You will want to change the link in the image to go to the appropriate location.
I believe the file should be located in:
/app/design/frontend/yourtemplate/yourtemplate/page/html/header.phtml
use http:// like bellow
http://www.otherdomain.com in your anchor tag
Just in case someone else comes here looking for the answer, in the file named above, at line 105 (v1.9.2) -
Add the url as below
<h1 class="logo"><strong class="no-display"><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $logo_src ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>