Get Alt/Title tag information using Jquery

Add this inside your head tag.

<script type="text/javascript">
$(document).ready(function(){
 
$(’div.test’).html(function() {
var linkTitle = $("#imgs-test").attr("alt");
return linkTitle;
});
 
});
</script>

Give the image for example an ID

ID="imgs-test"

Place this within the body tag where ever you want the information to be displayed.

<div class="test"></div>

Quickly Get Google Map Coordinates via URL

Enter your required location as normal
Clear the address bar and enter the following javascript and hit return

javascript:void(prompt(”,gApplication.getMap().getCenter()));

Get Parent Category Name in Magento

Post Image

<?php $parentname = $this->getCurrentCategory()->getParentCategory()->getName(); echo $parentname; ?>

Jquery Conflict with Prototype in Magento

Post Image

To use Jquery along with Prototype add the following code in your Jquery Script.

Get Skin Directory URL With a Template

Post Image

This code gets the Skin URL for when you are including Images etc within your template.

<?php echo $this->getSkinUrl(’images/YOURFILE.jpg’) ?>

Please ensure you close the gap between < ? and ? >

Static Block Within A Template

Post Image

This code allows you to add the content of a static block to your template.

 Page 4 of 8  « First  ... « 2  3  4  5  6 » ...  Last »