Skip to content

Instantly share code, notes, and snippets.

View pablocattaneo's full-sized avatar

Pablo Cattaneo pablocattaneo

View GitHub Profile
@pablocattaneo
pablocattaneo / magento-block.php
Created November 24, 2015 15:05
Code to add magento block in cms a page
{{block type="cms/block" block_id="blcok-id"}}
<!-- Example-->
{{block type="cms/block" block_id="banner-monroe"}}
<form action="" id="formualrioMonroe" novalidate>
<input type="tel" name="dni" placeholder="Ingresá tu DNI" id="dni" class="required-entry validate-number"/> <!-- para validar un determinado campo se agrega un clase css ya predefinida en el validador por ejemplo required-entry make de field mandatory -->
<input type="email" name="email" placeholder="Ingresá tu correo" id="email" class="required-entry validate-email"/>
<input type="submit" value="Obtener Cupón" class="button">
</form>
<!-- scrip para validar el formulario -->
<script type="text/javascript">
//< ![CDATA[
var customForm = new VarienForm('formualrioMonroe'); // ID del formulario a validar
@pablocattaneo
pablocattaneo / filename-tool-long
Created November 27, 2015 17:41
Fix the "Filename too long in git for windows"
Open the terminal and run:
git config --system core.longpaths true
@pablocattaneo
pablocattaneo / gulpfile.js
Last active September 16, 2017 00:10
Reference gulpfile.js Proyecto pablocattaneo
//required section
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
minifyCss = require('gulp-minify-css'),
sass = require('gulp-sass'),
rename = require('gulp-rename');
@pablocattaneo
pablocattaneo / ajax.html
Created December 1, 2015 16:05
Mi primer ajax Jquery.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script src="jquery-1.11.3.min.js"></script>
<script>
$(document).ready(function() {
$.post( "request.php",function(data) { // 1-el sgundo parámetro, function es el callback cuando el request da success el parámetro dentro del mismo, data es la todo el contenido del sitio
$('.ver').click(function(event) {
@pablocattaneo
pablocattaneo / config.xml
Last active September 16, 2017 00:10
support pdf for WYSIWYG Magento: In order to allow to upload and link pdf file, I modified your config.xml Spurce: http://magento.stackexchange.com/questions/55302/magento-1-9-1-0-upload-pdf-file-type-in-wysiwyg-editor-and-show-pdf-icon
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Pdf_WysiwygFiles>
<version>1.0.0</version>
</Pdf_WysiwygFiles>
</modules>
<adminhtml>
<cms>
<browser>
@pablocattaneo
pablocattaneo / get_the_category_list.php
Created December 4, 2015 00:07
Shows all categories of a post
<?php echo get_the_category_list(); ?> // shows all categories of a post'
@pablocattaneo
pablocattaneo / grunt-sitemap.php
Last active September 16, 2017 00:09
Uncss for Wordpress Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php After thatrun http://yourdomain.com?show_sitemap to get all url of your site an then paste it here: //Uncss task gulp.task('uncss', fu…
<?php
/**
* Plugin Name: Grunt Sitemap Generator
* Plugin URI: http://www.github.com/lgladdy
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/
<?php echo Mage::getUrl('laplazadetumascota'); ?>
Devuelve: http://www.carrefour.com.ar/laplazadetumascota
@pablocattaneo
pablocattaneo / image-by-default.php
Created December 20, 2015 21:54
Si el usuario no sube un thumbanil al post se muestra una imagen por defecto.
<?php
// Must be inside a loop.
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
else {
echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/thumbnail-default.jpg" />';
}
?>