magento found valid path image in new page - magento

i have created a new page using CMS->Page->Add New Page, My page title is About Us and the url key is about-us, in content i have insert this
{{block type="core/template" template="content/about-us.phtml"}}
this my code from about-us.phtml
<div>
<img src="skin/frontend/default/blank/images/mypic.jpg"/>
</div>
my problem is image (mypic.jpg) doesnt show in about us page, please help me..
thx..

you should have to use getSkinUrl function to work with your current skin of front end and grep image from it.
<div>
<img src="<?php echo $this->getSkinUrl('images/mypic.jpg');?>"/>
</div>
hope this will sure help you.

Alternate Solution:
<img src="{{skin url='images/yopur-image.png'}}" alt="" />
Image File Location is:-
\magento\skin\frontend\default\default\images

Related

How to update an image in the get_template_directory_uri()?

I need to update the header image on the front page of our website. I found the code in the Theme Editor for the header.php. The current image link is there but I can't find the template directory to add the new image to be able to swap them out. How would I go about finding the template directory to add in / update the image?
Old Photo: /images/woolpower-home-bg.jpg
New Photo: https://woolpowerus.com/wp-content/uploads/2021/09/Header-Kollag-2021.jpg
<?php if (is_front_page()): ?>
<header class="home-banner jarallax">
<img class="jarallax-img" src="<?php echo get_template_directory_uri(); ?>/images/woolpower-home-bg.jpg" alt="woolpower" title="woolpower">
<div class="control-content">
<div class="container">
<div class="box-content">
<h1>Why Woolpower?</h1>
<p> Because we manufacture underwear and reinforcement garments all the way from yarn to finished product in Ă–stersund, Sweden. We are a company that takes responsibility for people, animals and nature. The clothes are sewn to last and adapted to extreme weather conditions. But at the same time, they should keep you warm in your everyday life. </p>
</div>
</div>
</div>
</header>
Could I use -
<img src="<?php echo get_template_directory_uri(); ?
>/uploads/2012/09/Header-Kollag-2021.jpg" />
It looks like get_template_directory_uri is returning https://woolpowerus.com/wp-content/themes/targetmarket so src="<?php echo get_template_directory_uri(); ?>/uploads/2012/09/Header-Kollag-2021.jpg" would point to the wrong location.
You could re-upload the image under the theme's folder or use src="https://woolpowerus.com/wp-content/uploads/2021/09/Header-Kollag-2021.jpg"

Changing the onclick URL on Tumblr photosets

I have a tumblr blog embedded into my website (iframe) and want all clicks to open in a new tab to land on the post detail url (e.g. https://diestadtgaertner.tumblr.com/post/657405245299818496). I already adapted the template to get this working for most post types by exchanging the respective href variable with "https://diestadtgaertner.tumblr.com/post/{PostID}" and add target="_blank". However, I can't get this to work for the pictureset. Does anyone know how this might work?
Help would be greatly appreciated!
Thanks & best,
Torge
You can edit your template so the photoset gets output into a normal div (I think the default is to load photosets inside an iframe themselves, which could be causing you issues.
This is the block from my tumblr template:
<ul>
...
{block:Photoset}
<li class="post photoset">
{block:Photos}
<img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
{block:HighRes}
<img src="{PhotoURL-HighRes}" class="highres" />
{/block:HighRes}
{/block:Photos}
{block:Caption}
<div class="description">{Caption}</div>
{/block:Caption}
<p>
<span class="icon-link ion-ios-infinite-outline"></span>
{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}
</p>
</li>
{/block:Photoset}
</ul>
In any case you could wrap the entire block in the Permalink href. Something like:
<ul>
...
{block:Photoset}
<li class="post photoset">
<a href="{Permalink}"> // this permalink href now wraps the entire content of the post.
{block:Photos}
<img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
{block:HighRes}
<img src="{PhotoURL-HighRes}" class="highres" />
{/block:HighRes}
{/block:Photos}
{block:Caption}
<div class="description">{Caption}</div>
{/block:Caption}
</a>
</li>
{/block:Photoset}
</ul>
The issue now is that the default click links for the images inside this post (if they exist) will no longer function normally.
It is difficult to test this without the link to your site, but I think updating your tumblr template first should hopefully give you the result you are after, but of course I would recommend a backing up your code.

tinyMCE image output

i'm using TinyMCE for custom insert image, the problem is when i insert image with advimage, example
http://mysite/folder/image.jpg
but the image link when it loads become
<img title="" src="../../image.jpg" alt=" " width="450" height="581" />
how can i get the output to become like
<img title="" src="http://mysite/folder/image.jpg" alt=" " width="450" height="581" />
sorry for my bad english
thank you
Have a look at one of moxiecodes tinymce example pages:
http://www.tinymce.com/tryit/url_conversion.php
I guess this will show you how to configure your tinymce.
tinyMCE.init({
// General options
convert_urls : false,
...

How to stop auto-refresh onclick from thumbnails?

I have an image gallery on my site that uses thumbnails that enlarge above the thumbnail line when clicked on. I'm having an issue with the auto-refresh; every time I click one of the thumbnails, the page refreshes, which restores it to the "master image".
I'm not (and sort of refuse, on the grounds that I believe all this can be done with simple CSS and HTML) using anything fancy to write this code, despite my knowledge of HTML being amateur at best.
Here's a sample of the code. Let me know if you need to see a different piece of it.
<div id="rightcol">
<img name="ImageOnly. src='#' /><img src="#" />
</div>
<div id="leftcol"> <div>
<a href="" onclick="ImageOnly.src='#'"><img src="#" />
</div>
Edit: Somehow I seem to have fixed this issue by changing
<a href="" onclick="ImageOnly.src='#'">
to
<a href="#" onclick="ImageOnly.src='#'">
Not really sure why this worked but would love an explanation...?
Why not just use some simple ajax/javascript .innerHTML? instead of trying to stop the auto refresh that occurs when you click on a hyperlink that has #. That way you could update the rightcol synchroniously.
HTML
<div id="rightcol">
<img name="ImageOnly.src" src='#' />
</div>
<div id="leftcol">
<img src="#" />
</div>
AJAX Script
function ajaxMove(src)
{
var image = '<img src="'+src+'" alt="my transferred image" />';
document.getElementById('rightcol').innerHTML = image;
}
How is it used?
Request the object from the onclick event.
Build an image tag based off the information in the object.
Transfer the new image tag to the element with the id 'rightcol'
Other options
You could also remove the href="#" from the <a> tag and work directly from the onclick event and then apply style="cursor:pointer;". Then it will work like a regular hyperlink but without the refresh.
<a onclick="javascript:ajaxMove('ImageOnly.src')" style="cursor:pointer;" >Click Me</a>

Pinterest pinit button not working on my website the image does not show it appears broken

[ProductTitle]
[ThumbnailImage]
<a href="http://pinterest.com/pin/create/button/?url=lerivinos.com&media=lerivinos.com"
class="pin-it-button"
count-layout="horizontal">
Pin It
</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
[OurPrice]
[AddToCart]
your sample code doesn't have the img link which pinterest give you in the code snippet.
Assuming you mis-copied and omitted it, I had the same problem because pinterest give you this:
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
I had to add http: to the src to get it to work, ie:
<img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It" />
Hope that helps.
The media parameter of your pintrest url should point at your image file, like so:
<a href="http://pinterest.com/pin/create/button/?url=lerivinos.com&media=https://www.google.com/images/srpr/logo3w.png"
class="pin-it-button"
count-layout="horizontal">
Pin It
</a>
From the pintrest goodies page

Resources