domingo, 5 de marzo de 2017

Entradas Resumidas estilo Blogofmovie para Blogger


Bien, esta vez sin tantas palabras les diré los pasos a seguir; primero entra en Diseño | Edición de HTML, marca la casilla Expandir plantillas de artilugios y busca esta línea, Ten en cuenta que es el segundo resultado:

<data:post.body/>

Elimínala y en su lugar pon esto:

<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
<span class='rmlink' style='float:right'><a expr:href='data:post.url'>Leer más...</a></span>
</b:if></b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>

Ahora antes de </head> pega lo siguiente:

<script type='text/javascript'>
summary_noimg = 200;
summary_img = 180;
img_thumb_height = 60;
img_thumb_width = 60;
summary_noimg1 = 850;
summary_img1 = 780;
img_thumb_height1 = 125;
img_thumb_width1 = 125;

</script>

<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}

function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) { 
imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';
summ = summary_img;
}

var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}

function createSummaryAndThumb1(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg1;
if(img.length>=1) { 
imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width1+'px" height="'+img_thumb_height1+'px"/></span>';
summ = summary_img1;
}

var summary1 = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary1;
}

//]]>
</script>

Ahora vamos a Personalizar, En los dos primeros códigos que hemos agregado aparece en color rojo el texto Leer más... ese se puede cambiar por otro o bien poner una imagen en su lugar, para tal caso se debe eliminar ese texto y poner este código:


<img src="URL de la imagen" />

Sólo agrega la URL de tu imagen donde se indica y listo. Eso deberás hacerlo en los dos texto de Leer más... para que el cambio se vea tanto en la primera entrada como en el resto de ellas.

Después viene la parte del resumen de las entradas donde podremos modificar el tamaño de la imagen y el texto. Debajo de </head>, al inicio del script que pegamos se encuentra esta parte:

summary_noimg = 200;
summary_img = 180;
img_thumb_height = 60;
img_thumb_width = 60;
summary_noimg1 = 850;
summary_img1 = 780;
img_thumb_height1 = 125;
img_thumb_width1 = 125;

El primer número es el número de caracteres que se motrarán en las entradas cuando no haya una imagen.
El segundo número es el número de caracteres cuando hay una imagen.
El tercero y último es el alto y ancho de la imagen en miniatura.
Lo mismo para lo que está en color azul, pero esa configuración sólo afecta al primer post. Como el primer post es más ancho entonces cabrán mayor número de caracteres y podrás hacer más grande el tamaño de la miniatura.

Compartir:

PAG WEB de Farmacia con HTML5 y CSS

Interfaz Principal de la Página Tamaño de Escritorio: Tamaño de Tablet: Tamaño de Celular Movil: Armado de l...