ayuda plugin content_dump

La discusión del CMS Made Simple en español.

Moderator: hexdj

Locked
uloloi
Forum Members
Forum Members
Posts: 88
Joined: Thu Dec 16, 2010 8:50 pm

ayuda plugin content_dump

Post by uloloi »

Hola amigos, estoy un poco verde con respecto a como usar este plugin content_dump. Una pregunta muy basica, no es un modulo, estoy viendo que es un plugin: Como se instala un plugin? solamente debo de copiar el archivo function.content_dump.php a mi_sitio/plugins ?, o me hace falta configurar algo ma, es que no me muestra nada al querer utilizarlo en esta ayuda: http://wiki.cmsmadesimple.org/index.php ... ntent_dump estoy tratando de seguir los pasos

Alguna ayuda, Gracias.
Vivir en una sociedad pluralista y justa sólo puede lograrse a través del compromiso con valores como: {Libertad responsable, Solidaridad, Igualdad, Respeto activo, Diálogo}
Sonya

Re: ayuda plugin content_dump

Post by Sonya »

uloloi wrote:Como se instala un plugin? solamente debo de copiar el archivo function.content_dump.php a mi_sitio/plugins?
Yes, just copy the function.content_dump.php into the folder /plugins. No further installation. You can find the plugin in admin panel Extensions » Tags where you can see the help link in English.

You can start by adding:

Code: Select all

{content_dump}
{foreach from=$dump item=dump}
<h2>{$dump->content->title}</h2>
{/foreach}
into a page or template. This small piece of code would output all titles of the pages that are active and marked to be shown in menu. Then you can go through wiki help to see how you can refine it.

Sorry for writing in English. My written Spanish is awful :-[
uloloi
Forum Members
Forum Members
Posts: 88
Joined: Thu Dec 16, 2010 8:50 pm

Re: ayuda plugin content_dump

Post by uloloi »

Hi Sonya, I appreciate the help you have given me.

Now that I'm aware of the extensive possibilities of content_dump I found a small detail. In the online help of content_dump talks about how to create blogs using as content_blocks summary, but in the pages created, unlike the news, I don't see an option to create some summary. Well, what I do is use $dump [n]->content to bring the entire contents of the article published. What I'm looking for this string is: [1st] Coming with html tags, if it have any embedded image, take only the first image, [2nd] then later cancel the entire html (content_dump ... html = 'strip' ...)

Bueno, ya no supe si va en español o no XD XD

Salu2! a to2! y Feliz Año!
Sonya

Re: ayuda plugin content_dump

Post by Sonya »

uloloi wrote:What I'm looking for this string is: [1st] Coming with html tags, if it have any embedded image, take only the first image, [2nd] then later cancel the entire html (content_dump ... html = 'strip' ...)
It is diffucult to realize it this way. What I would recommend is to output content this way

Code: Select all

{$dump->content->data|truncate:400:"..."|strip_tags}
Where the number of characters is cut by 400 (truncate:400:"...") and all HTML tags are stripped (strip_tags). Then load and install the module GBFilePicker. This module allows you to upload and attach an image to your page. To integrate the module, add somewhere in your template (probably after the tag {content} the module call:

Code: Select all

{content_module block="pageimage" module="GBFilePicker" assign="pageimage"}
With content_dump you can now get the page image and format your output the way, you like. Example:
{content_dump limit_count="10" first_sort="created" first_sort_order="down" extensions="pageimage"}

Code: Select all

{foreach from=$dump item=dump}
<h1>{$dump->content->title}</h1>
<p><a href="{cms_selflink href=$dump->content->alias}"><img src="uploads/{$dump->extensions->pageimage->data}" alt="{$dump->content->title}" /></a></p>
<p>{$dump->content->data|truncate:400:"..."|strip_tags}</p>
{/foreach} 
This is the better and cleaner way to solve your idea.

PS: Puedes escribir en español, lo puedo entender. Me gusta este idioma más ;). He aprendido español hace 10 años pero nunca he hablado. Por último, este es el Foro Español :) Feliz Año!
uloloi
Forum Members
Forum Members
Posts: 88
Joined: Thu Dec 16, 2010 8:50 pm

Re: ayuda plugin content_dump

Post by uloloi »

Hola Sonya, gracias por tu ayuda, cree un custom_tag:extract_image para extraer la primer imagen proveniente de dump[n]->content->data, todo funcionaba bien [CLAP!! O0 ] pero al usar dos veces mi {extract_image}, en el código php de esta tengo una funcion getImage(param,...) {} en el template me muestra ERROR: Fatal error: Cannot redeclare extract_image() (previously declared in C:\...\lib\content.functions.php(975) : eval()'d code:3) in C:\...\lib\content.functions.php(975) : eval()'d code on line 3, porque estoy llamando mas de una vez este smarty tag

[RESUELTO]:
if(!function_exists('extractImage')){
...
}

Content_dump es excelente! GRACIAS
Locked

Return to “Spanish - Español”