<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2158598821071141596</id><updated>2011-12-29T22:56:18.168-08:00</updated><category term='images'/><category term='xml'/><category term='url'/><category term='templates'/><category term='dialog'/><category term='navigation'/><category term='comment'/><category term='dynamic'/><category term='ajax'/><category term='subtemplate'/><category term='theme'/><category term='autocompletion'/><category term='singleton'/><category term='paragraph'/><category term='autocomplete'/><category term='asset'/><category term='dam'/><category term='jquery'/><category term='stk'/><category term='custom'/><category term='styles'/><category term='css'/><category term='Flickr'/><category term='auto generate'/><category term='parameter'/><category term='magnolia_cms'/><category term='activation'/><category term='magnolia'/><category term='data'/><category term='repository'/><title type='text'>Teresa @ Magnolia_CMS</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-5914243326802027840</id><published>2011-12-19T04:35:00.000-08:00</published><updated>2011-12-26T03:23:00.531-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='paragraph'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='autocompletion'/><category scheme='http://www.blogger.com/atom/ns#' term='autocomplete'/><title type='text'>Rendering Paragraphs with AJAX, Part III: Autocomplete example</title><content type='html'>In Rendering Paragraphs with AJAX&amp;nbsp;&lt;a href="http://tmiyar.blogspot.com/2011/10/rendering-paragraphs-with-ajax-part-i.html"&gt;Part 1&lt;/a&gt;&amp;nbsp;and &lt;a href="http://tmiyar.blogspot.com/2011/11/rendering-paragraphs-with-ajax-part-ii.html"&gt;Part 2&lt;/a&gt;&amp;nbsp;I showed basic examples of using AJAX in paragraphs in Magnolia CMS. In&amp;nbsp;this last post, I demonstrate how to create a predictive search for contacts and how to render a contact's details when it is selected.&lt;br /&gt;&lt;br /&gt;The end result looks like this, hoping it motivates you to read the whole post :-). It is a new paragraph that contains a text box. You type a contact name in the box and the paragraph starts listing matching contacts from the directory.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/--8I7iHdyFw8/Tu8lcuViI6I/AAAAAAAAARU/tglN8wcjTrA/s1600/Screen+shot+2011-12-19+at+12.50.54+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/--8I7iHdyFw8/Tu8lcuViI6I/AAAAAAAAARU/tglN8wcjTrA/s1600/Screen+shot+2011-12-19+at+12.50.54+PM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;When you select one of the contacts, a contact paragraph is rendered, displaying full contact information from the directory.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-xCd5QwMC7eM/Tu8leQNdLlI/AAAAAAAAARc/8wQXj_a7ffo/s1600/Screen+shot+2011-12-19+at+12.51.52+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-xCd5QwMC7eM/Tu8leQNdLlI/AAAAAAAAARc/8wQXj_a7ffo/s1600/Screen+shot+2011-12-19+at+12.51.52+PM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;What is needed to achieve this? A paragraph, a model class and of course a nice &lt;a href="http://jqueryui.com/demos/autocomplete/"&gt;jQuery Autocomplete widget&lt;/a&gt;. The last bit is what makes this example so simple to create.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Paragraph script&lt;/h2&gt;The paragraph script looks like this.&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; [#assign cms=JspTaglibs["cms-taglib"]]   &lt;br /&gt; [#include "/autocomplete/paragraphs/macros/ajax.ftl"]  &lt;br /&gt; [#-- TODO This link and script MUST BE MOVED to a file into the theme --]    &lt;br /&gt; &amp;lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"   &lt;br /&gt;    rel="stylesheet" type="text/css"/&amp;gt;  &lt;br /&gt; &amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&amp;gt;&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt; &amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&amp;gt;&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt; [#-- End TODO --]&lt;br /&gt; [#assign contentLink= mgnl.createLink(content)!]  &lt;br /&gt; &amp;lt;script&amp;gt;  &lt;br /&gt; jQuery(document).ready(function() {  &lt;br /&gt;    jQuery("input#autocomplete").autocomplete({  &lt;br /&gt;       source: function( request, response ) {  &lt;br /&gt;          jQuery.getJSON('${contentLink}', {term : request.term}, function(data) {  &lt;br /&gt;             response(data);  &lt;br /&gt;             });  &lt;br /&gt;          },  &lt;br /&gt;       select: function( event, ui ) {  &lt;br /&gt;          jQuery.get('${contentLink}', { uuid: ui.item.uuid},function(data) {  &lt;br /&gt;          jQuery('#ajax').html(data);  &lt;br /&gt;          });  &lt;br /&gt;          return false;  &lt;br /&gt;          }  &lt;br /&gt;       });  &lt;br /&gt;    });  &lt;br /&gt; &amp;lt;/script&amp;gt;  &lt;br /&gt; [@cms.editBar /]  &lt;br /&gt; &amp;lt;div&amp;gt;  &lt;br /&gt;    Find Contacts: &amp;lt;input id="autocomplete" /&amp;gt;  &lt;br /&gt;    &amp;lt;div id="ajax"&amp;gt;  &lt;br /&gt;    &amp;lt;/div&amp;gt;  &lt;br /&gt; &amp;lt;/div&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Note that the links to jQuery UI cannot be placed directly in the script as I have done here. The code above is just a demonstration so you can see what files are needed. See &lt;a href="http://jqueryui.com/demos/autocomplete/"&gt;jQuery Autocomplete documentation&lt;/a&gt;&amp;nbsp;for details.&lt;br /&gt;&lt;br /&gt;The paragraph script renders an input field that has an ID&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;autocomplete&lt;/span&gt;. The source for this field is a JSON object provided by the paragraph model via an AJAX call. The JSON object provides contact names starting with the string you type in the input field. When a contact is selected, a second AJAX call asks the paragraph model to render a contact paragraph using the UUID of the selected item.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Autocomplete paragraph model class&lt;/h2&gt;The paragraph model class for autocomplete looks like this.&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; public String execute() {  &lt;br /&gt;    String uuid = MgnlContext.getParameter("uuid");  &lt;br /&gt;    //first it will run the autocomplete  &lt;br /&gt;    if(StringUtils.isEmpty(uuid)) {  &lt;br /&gt;       return renderAutocomplete();  &lt;br /&gt;    } else {  &lt;br /&gt;       return renderParagraph(uuid);  &lt;br /&gt;    }  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;There are two method calls in the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;execute&lt;/span&gt; method:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;renderAutocomplete&lt;/span&gt;&amp;nbsp;returns a JSON object of contact names and UUIDs.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;renderParagraph&lt;/span&gt;&amp;nbsp;renders a contact paragraph for the selected UUID.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;renderAutocomplete method&lt;/h3&gt;The &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;renderAutocomplete&lt;/span&gt; method looks for the contact information by &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;givenName&lt;/span&gt;&amp;nbsp;and then constructs a JSON object with two fields,&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;label&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;uuid&lt;/span&gt;, and sends it to the response.&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; private String renderAutocomplete() {  &lt;br /&gt;    String autocomplete = "";  &lt;br /&gt;    String repositoryId = "data";  &lt;br /&gt;    String dataType = "Contact";  &lt;br /&gt;    String propertyName = "givenName";  &lt;br /&gt;    String term = MgnlContext.getParameter("term");  &lt;br /&gt;    if(StringUtils.isNotEmpty(term)){  &lt;br /&gt;       String statement = "//element(*, "+ dataType +")[jcr:like(fn:upper-case(@"    &lt;br /&gt;          + propertyName + "),'%" + term.toUpperCase() + "%')]";  &lt;br /&gt;       Collection&amp;lt;Content&amp;gt; nodes = QueryUtil.query(repositoryId, statement , "xpath");    &lt;br /&gt;       autocomplete +="[";  &lt;br /&gt;       Iterator&amp;lt;Content&amp;gt; it = nodes.iterator();  &lt;br /&gt;       while (it.hasNext()) {  &lt;br /&gt;          Content node = it.next();  &lt;br /&gt;          autocomplete += "{ \"label\":\"" + NodeDataUtil.getString(node, propertyName)   &lt;br /&gt;          + " " + NodeDataUtil.getString(node, "familyName") + "\", \"uuid\": \"" &lt;br /&gt;          + node.getUUID() +"\"}";  &lt;br /&gt;          if(it.hasNext()) {  &lt;br /&gt;             autocomplete += ",";  &lt;br /&gt;          }   &lt;br /&gt;       }  &lt;br /&gt;       autocomplete +="]";  &lt;br /&gt;       try {  &lt;br /&gt;          MgnlContext.getWebContext().getResponse().getOutputStream().print(autocomplete);  &lt;br /&gt;          } catch (IOException e) {  &lt;br /&gt;            // TODO Auto-generated catch block  &lt;br /&gt;            e.printStackTrace();  &lt;br /&gt;       }  &lt;br /&gt;       return RenderingModel.SKIP_RENDERING;  &lt;br /&gt;    }  &lt;br /&gt; return super.execute();  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;renderParagraph method&lt;/h3&gt;The &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;renderParagraph&lt;/span&gt; method is bit more complex because what we want to render is of type Contact. Instead of using the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;renderParagraph&lt;/span&gt;&amp;nbsp;method from &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;MagnoliaTemplatingUtilities&lt;/span&gt;, we have to render it using&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ParagraphRendererManager&lt;/span&gt;.&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; private String renderParagraph(String uuid) {  &lt;br /&gt;    String repositoryId = "data";  &lt;br /&gt;    String paragraphName = "contact";  &lt;br /&gt;    Content ajaxContent = ContentUtil.getContentByUUID(repositoryId, uuid);  &lt;br /&gt;    if(ajaxContent != null) {  &lt;br /&gt;       try {  &lt;br /&gt;          if (ajaxContent != null &amp;amp;&amp;amp; ajaxContent.isNodeType(ItemType.CONTENTNODE.getSystemName())) {  &lt;br /&gt;             MagnoliaTemplatingUtilities.getInstance().renderParagraph(ajaxContent,   &lt;br /&gt;                MgnlContext.getWebContext().getResponse().getWriter(), paragraphName);  &lt;br /&gt;          } else if(ajaxContent != null &amp;amp;&amp;amp; !ajaxContent.isNodeType(ItemType.CONTENTNODE.getSystemName())) {  &lt;br /&gt;             //this bit of code is needed as content is not a contentnode, is a datatype from data repo.  &lt;br /&gt;             Paragraph paragraph = ParagraphManager.getInstance().getParagraphDefinition(paragraphName);  &lt;br /&gt;             ParagraphRenderer renderer = ParagraphRendererManager.getInstance().getRenderer(paragraph.getType());  &lt;br /&gt;             renderer.render(ajaxContent, (Paragraph) paragraph, MgnlContext.getWebContext().getResponse().getWriter());  &lt;br /&gt;          }  &lt;br /&gt;       } catch (RenderException e) {  &lt;br /&gt;          // TODO Auto-generated catch block  &lt;br /&gt;          e.printStackTrace();  &lt;br /&gt;       } catch (IOException e) {  &lt;br /&gt;          // TODO Auto-generated catch block  &lt;br /&gt;          e.printStackTrace();  &lt;br /&gt;       }  &lt;br /&gt;    }  &lt;br /&gt;    return RenderingModel.SKIP_RENDERING;  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Contact paragraph model class&lt;/h2&gt;For the Contact paragraph, I just used the &lt;a href="http://svn.magnolia-cms.com/svn/community/modules/standard-templating-kit/tags/standard-templating-kit-1.4.5/magnolia-module-standard-templating-kit/src/main/java/info/magnolia/module/templatingkit/paragraphs/ContactModel.java"&gt;one provided by STK&lt;/a&gt; and changed the model to get the content from the UUID provided.&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; public String execute() {  &lt;br /&gt;    String uuid = MgnlContext.getParameter("uuid");  &lt;br /&gt;    if(StringUtils.isEmpty(uuid)) {  &lt;br /&gt;       uuid = getContent().getNodeData("contact").getString();  &lt;br /&gt;    }  &lt;br /&gt;    HierarchyManager hm = MgnlContext.getHierarchyManager(DataModule.getRepository());  &lt;br /&gt;    if (!StringUtils.isEmpty(uuid)) {  &lt;br /&gt;       try {  &lt;br /&gt;          contact = hm.getContentByUUID(uuid);  &lt;br /&gt;          } catch (RepositoryException e) {  &lt;br /&gt;             throw new RuntimeException(e);  &lt;br /&gt;       }  &lt;br /&gt;    }   &lt;br /&gt;    return super.execute();  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;a href="http://svn.magnolia-cms.com/svn/community/sandbox/autocomplete/trunk/"&gt;Download the code for this example&lt;/a&gt;&amp;nbsp;from the Magnolia SVN. It is just a working sample to demonstrate this functionality and might be removed at some point so better grab it quick!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-5914243326802027840?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/5914243326802027840/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/12/rendering-paragraphs-with-ajax-part-iii.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/5914243326802027840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/5914243326802027840'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/12/rendering-paragraphs-with-ajax-part-iii.html' title='Rendering Paragraphs with AJAX, Part III: Autocomplete example'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/--8I7iHdyFw8/Tu8lcuViI6I/AAAAAAAAARU/tglN8wcjTrA/s72-c/Screen+shot+2011-12-19+at+12.50.54+PM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-6312377974336679933</id><published>2011-11-29T05:50:00.001-08:00</published><updated>2011-11-30T07:51:42.552-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic'/><category scheme='http://www.blogger.com/atom/ns#' term='paragraph'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='parameter'/><title type='text'>Rendering Paragraphs with AJAX, Part II</title><content type='html'>In &lt;a href="http://tmiyar.blogspot.com/2011/10/rendering-paragraphs-with-ajax-part-i.html"&gt;Rendering Paragraphs with AJAX Part 1&lt;/a&gt;, I showed a basic example of an AJAX paragraph in Magnolia CMS. We loaded an paragraph via an AJAX call and rendered it on the page.&lt;br /&gt;&lt;br /&gt;Now we will see how to send parameters on the AJAX call and display changes by using the &lt;a href="http://documentation.magnolia-cms.com/reference/templating.html"&gt;model class&lt;/a&gt;.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For a use case, suppose you have to display a large amount of content. To make the content easier for the user to browse, you add pagination. You only want to update the paginated content when the user clicks a Previous or Next button.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You need a way to tell the server what page the user is currently on. The server can then provide the previous page or the next page. In order to do this you need a model class, a paragraph definition and a Freemarker template script (.ftl file).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Template script&lt;/h2&gt;Add the following code to your Freemarker template script:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; white-space: pre;"&gt;&amp;lt;div id="ajax"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;[#assign pageIndex = model.pageIndex]&lt;br /&gt;&amp;lt;script&amp;gt;&lt;br /&gt;function next() {&lt;br /&gt;    jQuery.get('${ctx.contextPath}${content.@handle}.html',&amp;nbsp;&lt;br /&gt;{index: '${pageIndex}'}, &lt;br /&gt; function(data) {&lt;br /&gt;         jQuery('#ajax').html(data);&lt;br /&gt;     });  &lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;   Page: &amp;lt;span id="text"&amp;gt;${pageIndex}&amp;lt;/span&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;a href="javascript:next();"&amp;gt;NEXT&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;The content paragraph to be rendered is inside the div element that has an ID &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ajax&lt;/span&gt;. The script assigns the value that comes from the model method call&amp;nbsp;to a variable &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;pageIndex&lt;/span&gt;. In the script, an AJAX call reloads the current paragraph, passing a new parameter &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;index&lt;/span&gt; with the value we assigned earlier.&lt;br /&gt;&lt;br /&gt;In a nested div element, we write the current value of the variable on the page.&lt;br /&gt;&lt;br /&gt;On the last line, we create a NEXT link that the user can click. The click will execute the AJAX call, run the paragraph model, and return the new &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;pageIndex&lt;/span&gt; value.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Model class&lt;/h2&gt;Now let's see what the model class looks like.&lt;br /&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;public String execute() {&lt;br /&gt;        &lt;br /&gt;    String index = MgnlContext.getParameter("index");&lt;br /&gt;    if(StringUtils.isNotEmpty(index)) {&lt;br /&gt;        pageIndex = Integer.parseInt(index) +1;&lt;br /&gt;    }&lt;br /&gt;    return super.execute();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int getPageIndex() {&lt;br /&gt;    return pageIndex;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;The class has two methods:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Overridden execute method that reads the parameter we sent by clicking NEXT and adds 1 to &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;pageIndex&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;getPageIndex method to retrieve the value of the member variable &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;pageIndex&lt;/span&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;h2&gt;Paragraph definition&lt;/h2&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-NZ6kVLl_ZtI/TtY48fi0HuI/AAAAAAAAARM/RnqjjrxDgAg/s1600/Screen+shot+2011-11-30+at+3.07.14+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-NZ6kVLl_ZtI/TtY48fi0HuI/AAAAAAAAARM/RnqjjrxDgAg/s1600/Screen+shot+2011-11-30+at+3.07.14+PM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The rendered NEXT &amp;nbsp;button looks like this on the page.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-kdQOLrfXSjY/TtYqMTgsxUI/AAAAAAAAAQw/pcDc2YNG6PM/s1600/Screen%2Bshot%2B2011-11-30%2Bat%2B2.04.38%2BPM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="33" src="http://2.bp.blogspot.com/-kdQOLrfXSjY/TtYqMTgsxUI/AAAAAAAAAQw/pcDc2YNG6PM/s400/Screen%2Bshot%2B2011-11-30%2Bat%2B2.04.38%2BPM.png" width="57" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-6312377974336679933?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/6312377974336679933/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/11/rendering-paragraphs-with-ajax-part-ii.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/6312377974336679933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/6312377974336679933'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/11/rendering-paragraphs-with-ajax-part-ii.html' title='Rendering Paragraphs with AJAX, Part II'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-NZ6kVLl_ZtI/TtY48fi0HuI/AAAAAAAAARM/RnqjjrxDgAg/s72-c/Screen+shot+2011-11-30+at+3.07.14+PM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-5689290427440340665</id><published>2011-10-27T05:35:00.000-07:00</published><updated>2011-10-27T05:35:07.070-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic'/><category scheme='http://www.blogger.com/atom/ns#' term='paragraph'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><title type='text'>Rendering Paragraphs with AJAX, Part I</title><content type='html'>Ever wondered how to reload just some paragraphs on your page? Imagine you have pagination and you want to reload just the paginated paragraph when clicking previous/next? Is Magnolia CMS capable of this without complex coding? Yes, and on this post you will find some ways of achieving this.&lt;br /&gt;&lt;br /&gt;First thing to know is, since Magnolia CMS version 4.x paragraphs are autorenderable. What does this mean? It means you can copy the path of a paragraph, paste it in the address bar of your browser and you will see the paragraph rendered. Try the following URL from our demo site, it will render the teaser of the Article page.&lt;br /&gt;&lt;a href="http://demo.magnolia-cms.com/demo-project/main/00.html"&gt;http://demo.magnolia-cms.com/demo-project/main/00.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What can you do with this? It means you don't need to create a servlet or anything to render a paragraph dynamically on a page. Just a call to the appropriate script will let you load any paragraph on our page.&lt;br /&gt;&lt;br /&gt;Here is a sample using JQuery. Add this code into a .ftl file. You also need to create a paragraph definition and add it to be used in a template.&lt;br /&gt;&lt;pre&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;function loadArticleTeaser() {&lt;br /&gt;  jQuery.get('${contextPath}/demo-project/main/00.html',function(data) {&lt;br /&gt;    jQuery('#ajax').html(data);&lt;br /&gt;  });&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div&gt;&lt;br /&gt;&amp;lt;div id="ajax"&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href="javascript:loadArticleTeaser()"&amp;gt;Load Teaser via AJAX call &amp;lt;/a&amp;gt;&lt;span class="Apple-style-span" style="font-family: 'DejaVu Sans Mono', courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px; white-space: nowrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;The JQuery call &lt;a href="http://www.blogger.com/(http://api.jquery.com/jQuery.get/)"&gt;(http://api.jquery.com/jQuery.get/)&lt;/a&gt; will get the specified URL and, on success,  will run the method that loads the result&amp;nbsp;(paragraph)&amp;nbsp;from the AJAX call into a div with ID "ajax". To run the whole thing you just need to click the "Load Teaser via AJAX call" link.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a basic sample of an AJAX paragraph. In the next post you will see how to send parameters and process them in the paragraph model class.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-5689290427440340665?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/5689290427440340665/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/10/rendering-paragraphs-with-ajax-part-i.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/5689290427440340665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/5689290427440340665'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/10/rendering-paragraphs-with-ajax-part-i.html' title='Rendering Paragraphs with AJAX, Part I'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-8332499131470018542</id><published>2011-09-27T03:32:00.000-07:00</published><updated>2011-09-28T00:07:11.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='activation'/><category scheme='http://www.blogger.com/atom/ns#' term='comment'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='dialog'/><title type='text'>Tips &amp; Tricks: Make activation comment mandatory</title><content type='html'>With this tip, you can make everybody to write a comment when they send an activation request, though I cannot guarantee that comment would be meaningful!&lt;br /&gt;&lt;br /&gt;Step 1. Set property required=true in activation dialog.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-KUlIoR8le_E/ToGd1PsW5OI/AAAAAAAAAQg/dUD5M-x2_iE/s1600/Screen+shot+2011-09-27+at+11.50.16+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="294" src="http://3.bp.blogspot.com/-KUlIoR8le_E/ToGd1PsW5OI/AAAAAAAAAQg/dUD5M-x2_iE/s320/Screen+shot+2011-09-27+at+11.50.16+AM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Step 2. Add the following code to the saveOnClick property of the dialog.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;if(document.getElementById('comment').value != '')&amp;nbsp; {window.close();opener.mgnl.workflow.WorkflowWebsiteTree.submitActivation($('mgnlFormMain'));} else {alert('Must write a comment for activation.');}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MmnYn8RK-e8/ToGd4r07iFI/AAAAAAAAAQk/sGXKw94nnzg/s1600/Screen+shot+2011-09-27+at+11.52.12+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="214" src="http://3.bp.blogspot.com/-MmnYn8RK-e8/ToGd4r07iFI/AAAAAAAAAQk/sGXKw94nnzg/s400/Screen+shot+2011-09-27+at+11.52.12+AM.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-8332499131470018542?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/8332499131470018542/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/09/tips-tricks-make-activation-comment.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/8332499131470018542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/8332499131470018542'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/09/tips-tricks-make-activation-comment.html' title='Tips &amp; Tricks: Make activation comment mandatory'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-KUlIoR8le_E/ToGd1PsW5OI/AAAAAAAAAQg/dUD5M-x2_iE/s72-c/Screen+shot+2011-09-27+at+11.50.16+AM.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-2357299846073843374</id><published>2011-08-29T02:34:00.000-07:00</published><updated>2011-11-24T02:24:54.860-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='data'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='templates'/><category scheme='http://www.blogger.com/atom/ns#' term='repository'/><category scheme='http://www.blogger.com/atom/ns#' term='navigation'/><title type='text'>Creating site navigation from data nodes</title><content type='html'>&lt;div&gt;This solution has been implemented for &lt;a href="http://svn.magnolia-cms.com/view/forge/magnolia-shop/"&gt;Magnolia Shop Module&lt;/a&gt; (contributed by &lt;a href="http://www.fastforward.ch/"&gt;fastforward&lt;/a&gt;). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The aim is to create menu navigation based on nodes in the data repository. The navigation should be displayed on an existing site as section navigation. This way, when you navigate to the section, product categories defined in data repository will be used as items in the vertical menu. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/-MoOWhjC84ZM/Tl3bj6TOiiI/AAAAAAAAAP8/y-s-1iqcsx4/s1600/Screen%2Bshot%2B2011-08-31%2Bat%2B8.53.21%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5646910917784275490" src="http://1.bp.blogspot.com/-MoOWhjC84ZM/Tl3bj6TOiiI/AAAAAAAAAP8/y-s-1iqcsx4/s400/Screen%2Bshot%2B2011-08-31%2Bat%2B8.53.21%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 222px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;Note that the breadcrumb is also updated with the product categories.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Assuming  we know how the default navigation works in STK, we do the following:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Create customized navigation classes. One class will provide the navigation model and the second will define the navigation item that provides us with the item title and URL.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;See &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-shop/tags/magnolia-shop-product-categories-in-data-26102011/src/main/java/info/magnolia/module/shop/navigation/ProductCategoryNavigationModel.java?view=log"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ProductCategoryNavigationModel&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-shop/tags/magnolia-shop-product-categories-in-data-26102011/src/main/java/info/magnolia/module/shop/navigation/ProductCategoryNavigationItem.java?view=log"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ProductCategoryNavigationItem&lt;/span&gt;&lt;/a&gt; as examples. The &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-shop/tags/magnolia-shop-product-categories-in-data-26102011/src/main/java/info/magnolia/module/shop/navigation/ProductCategoryNavigationModel.java?view=log"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;getItems&lt;/span&gt;&lt;/a&gt; method returns the relevant nodes from the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;data&lt;/span&gt; repository. Constructor parameters for both classes depend on what you need for your implementation. In this particular case the parameter is specific to the shop, the shop name, so that we can create a correct link from the data repository.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="2"&gt;&lt;li&gt;Create a template model class that instantiates the customized navigation and assigns the model class to our template. Doing it this way, you keep the default navigation for all site content that is not part of the shop.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;See &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-shop/tags/magnolia-shop-product-categories-in-data-26102011/src/main/java/info/magnolia/module/shop/templates/ShopSingletonParagraphTemplateModel.java?view=log"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ShopSingletonParagraphTemplateModel&lt;/span&gt;&lt;/a&gt; where the navigation is instantiated.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;pre&gt;public ProductCategoryNavigationModel getProductCategoryNavigation() {return new ProductCategoryNavigationModel(getCurrentShop());}&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;As we are also customizing the breadcrumb, look at the getBreadcrumb method as well where items from the data repository are appended.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Once we have the model class ready, we add it to our template configuration&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-3hia3IWOxB4/Tl3eNmzZ3MI/AAAAAAAAAQU/pczo-zQLucQ/s1600/Screen%2Bshot%2B2011-08-31%2Bat%2B9.08.55%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5646913833128287426" src="http://3.bp.blogspot.com/-3hia3IWOxB4/Tl3eNmzZ3MI/AAAAAAAAAQU/pczo-zQLucQ/s360/Screen%2Bshot%2B2011-08-31%2Bat%2B9.08.55%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 32px; margin: 0px auto 10px; text-align: center; width: 360px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="3"&gt;&lt;li&gt;Freemarker templates.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;We optionally need a new &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-shop/tags/magnolia-shop-product-categories-in-data-26102011/src/main/resources/shop/templates/global/verticalNavigation.ftl?view=log"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;verticalNavigation.ftl&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;The only change in vertical navigation is to call our custom navigation that we created with a new name:&lt;/div&gt;&lt;div&gt;&lt;pre&gt;[@renderNavigation navigation=model.productCategoryNavigation /]&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;And we set the template file in the site configuration of our custom template definition:&lt;/div&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-QwO9UafRgU0/Tl3fx-oVFCI/AAAAAAAAAQc/J29TKuHtqo4/s1600/Screen%2Bshot%2B2011-08-31%2Bat%2B9.15.40%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5646915557511205922" src="http://4.bp.blogspot.com/-QwO9UafRgU0/Tl3fx-oVFCI/AAAAAAAAAQc/J29TKuHtqo4/s400/Screen%2Bshot%2B2011-08-31%2Bat%2B9.15.40%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 128px; margin: 0px auto 10px; text-align: center; width: 362px;" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-2357299846073843374?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/2357299846073843374/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/08/creating-site-navigation-from-data.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2357299846073843374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2357299846073843374'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/08/creating-site-navigation-from-data.html' title='Creating site navigation from data nodes'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-MoOWhjC84ZM/Tl3bj6TOiiI/AAAAAAAAAP8/y-s-1iqcsx4/s72-c/Screen%2Bshot%2B2011-08-31%2Bat%2B8.53.21%2BAM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-2918972332590481923</id><published>2011-07-12T06:16:00.001-07:00</published><updated>2011-09-27T03:57:39.515-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='theme'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='styles'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Adding extra styles files to an existing theme</title><content type='html'>The question raised when creating a new module: how can I add the styles files of my module to the pop theme?&lt;br /&gt;&lt;br /&gt;This guide shows how to add the installation task and how to bootstrap the content, but if you don't want to code anything, at the end of the blog there is an explanation on how to do it directly on the author instance:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;/i&gt;, Create the new styles file i.e. myextrastyles.css&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Step 2&lt;/i&gt;&lt;/b&gt;, Put the file in the module resources folder following STK theme structure, src/main/resources and the path shown in the following screenshoot:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-N50YhgBw6Y8/ThxKGC5f7MI/AAAAAAAAANk/mvrg_Dkn078/s1600/Screen%2Bshot%2B2011-07-12%2Bat%2B10.38.48%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5628455102023986370" src="http://2.bp.blogspot.com/-N50YhgBw6Y8/ThxKGC5f7MI/AAAAAAAAANk/mvrg_Dkn078/s320/Screen%2Bshot%2B2011-07-12%2Bat%2B10.38.48%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 120px; margin: 0px auto 10px; text-align: center; width: 300px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Step 3&lt;/i&gt;&lt;/b&gt;, Add an installation task on your module versionhandler.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;protected List getExtraInstallTasks(InstallContext installContext) {&lt;br /&gt;final List installTasks = new ArrayList();&lt;br /&gt;installTasks.addAll(super.getExtraInstallTasks(installContext));&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;installTasks.add(new InstallResourcesTask("/templating-kit/themes/pop/css/mystyles.css", &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;   "processedCss", STKResourceModel.class.getName()));&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Step 4&lt;/i&gt;&lt;/b&gt;, Update the theme configuration. In order for the theme to find the new style file, the file has to be configured in the theme configuration.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-MJpwEU57d1E/Th1HIjcvpPI/AAAAAAAAAO0/QO97_FvkDKc/s1600/Screen%2Bshot%2B2011-07-13%2Bat%2B9.07.37%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5628733321563317490" src="http://1.bp.blogspot.com/-MJpwEU57d1E/Th1HIjcvpPI/AAAAAAAAAO0/QO97_FvkDKc/s400/Screen%2Bshot%2B2011-07-13%2Bat%2B9.07.37%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 142px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Step 5&lt;/i&gt;&lt;/b&gt;, Export the configuration of our file shown in Step 4. Once exported you can place the file (config.modules.standard-templating-kit.config.themes.pop.cssFiles.myextrastyles.xml)&lt;br /&gt;in the bootstrap folder of your module.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;NOTE&lt;/span&gt;: All this can be achieved without any code, you just need to set the file in the theme configuration (Step 4) and upload this new styles file into the resources workspace.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-75YBNEncfpQ/Th1D3KCwh1I/AAAAAAAAAOU/L_qiylchD04/s1600/Screen%2Bshot%2B2011-07-13%2Bat%2B9.05.23%2BAM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5628729724150777682" src="http://4.bp.blogspot.com/-75YBNEncfpQ/Th1D3KCwh1I/AAAAAAAAAOU/L_qiylchD04/s400/Screen%2Bshot%2B2011-07-13%2Bat%2B9.05.23%2BAM.png" style="cursor: hand; cursor: pointer; display: block; height: 307px; margin: 0px auto 10px; text-align: center; width: 333px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-2918972332590481923?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/2918972332590481923/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/07/adding-extra-styles-files-to-existing.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2918972332590481923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2918972332590481923'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/07/adding-extra-styles-files-to-existing.html' title='Adding extra styles files to an existing theme'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-N50YhgBw6Y8/ThxKGC5f7MI/AAAAAAAAANk/mvrg_Dkn078/s72-c/Screen%2Bshot%2B2011-07-12%2Bat%2B10.38.48%2BAM.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-2657371581088642431</id><published>2011-03-10T06:39:00.000-08:00</published><updated>2011-12-20T00:15:27.891-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='asset'/><category scheme='http://www.blogger.com/atom/ns#' term='dam'/><category scheme='http://www.blogger.com/atom/ns#' term='url'/><category scheme='http://www.blogger.com/atom/ns#' term='images'/><category scheme='http://www.blogger.com/atom/ns#' term='Flickr'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><title type='text'>Adding Flickr images to Magnolia CMS</title><content type='html'>This is a step-by-step guide on how to create your custom DAM and plug it into Magnolia CMS. Will allow you to add images from external services like Flickr, as well as adding images from other servers using their url (It comes with a forge module!)&lt;br /&gt;&lt;br /&gt;This is a sample handle for external image/video urls, very basic as it does not add the imaging support for now.&lt;br /&gt;&lt;br /&gt;* Requirements - Standard Templating Kit Module&lt;br /&gt;&lt;br /&gt;1. The Asset&lt;br /&gt;&lt;br /&gt;We need to create our own Asset class that will implement the interface &lt;a href="http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/magnolia-module-standard-templating-kit/1.4.2/standard-templating-kit-parent/magnolia-module-standard-templating-kit/apidocs/info/magnolia/module/templatingkit/dam/Asset.html"&gt;Asset&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If we want to have exact same behavior  as in STK/ETK we will need to find a way to store 'meta data' (caption, description) of our assets, we could use the data module for that matter.&lt;br /&gt;&lt;br /&gt;In this sample we wont store any metadata for the images, nor use the imaging support.&lt;br /&gt;&lt;br /&gt;That leaves us with just one method to implement 'getLink' and this will be the value stored when we open the dialog to select an image.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;public String getLink() throws DAMException {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;return link;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Creation of link is on the class constructor, as easy as this&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;link = nodeData.getString();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. The handler.&lt;br /&gt;&lt;br /&gt;Should extend class &lt;a href="http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/magnolia-module-standard-templating-kit/1.4.2/standard-templating-kit-parent/magnolia-module-standard-templating-kit/apidocs/info/magnolia/module/templatingkit/dam/handlers/AbstractHandler.html"&gt;AbstractHandler&lt;/a&gt; . We will extend from AbstractHandler that has the methods to read the configuration, that leaves us with two methods to implement as needed: getAsset and getAssetByKey. In this case we implement getAsset to return an instance of our Asset.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;final String name = getNodeDataName(node, nodeDataPrefix); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Important thing to note here is that we need to get the name of the nodeData that has the url of our image. When you set an image using the dam controls, you name your node as i.e. 'myimage' and on saving you will get a nodeData with the name you gave plus the name of the dam control used. To make it simpler a call to the method &lt;a href="http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/magnolia-module-standard-templating-kit/1.4.2/standard-templating-kit-parent/magnolia-module-standard-templating-kit/apidocs/info/magnolia/module/templatingkit/dam/handlers/AbstractHandler.html#getNodeDataName(info.magnolia.cms.core.Content,%20java.lang.String)"&gt;getNodeDataName&lt;/a&gt; will give you the real name with which your node has been saved. In this sample it will contain the exact url of our image, no need of further processing.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;final NodeData nodeData = node.getNodeData(name);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This line above gets the node data, now with the right name.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;return new UrlAsset(nodeData);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is where we return our asset.&lt;br /&gt;&lt;br /&gt;3. The controls (configuration).&lt;br /&gt;&lt;br /&gt;Need to add the configuration for this external dam. For that we create a new node under our site configuration. There we put the handler we are going to use and the control/s in which we will store the image information. See image:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-QTQAlwmqc88/TYNi3VfUf0I/AAAAAAAAANM/EZIWQUDwcBI/s1600/Screen%2Bshot%2B2011-03-18%2Bat%2B2.46.40%2BPM.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5585416665670385474" src="http://3.bp.blogspot.com/-QTQAlwmqc88/TYNi3VfUf0I/AAAAAAAAANM/EZIWQUDwcBI/s200/Screen%2Bshot%2B2011-03-18%2Bat%2B2.46.40%2BPM.png" style="cursor: hand; cursor: pointer; height: 105px; width: 200px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And to finish this post there is a module in Magnolia forge &lt;a href="http://svn.magnolia-cms.com/svn/forge/magnolia-module-urldam/trunk/"&gt;magnolia-module-urldam&lt;/a&gt;  with the code to add an external dam handler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-2657371581088642431?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/2657371581088642431/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2011/03/adding-custom-dynamic-asset-handler.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2657371581088642431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/2657371581088642431'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2011/03/adding-custom-dynamic-asset-handler.html' title='Adding Flickr images to Magnolia CMS'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-QTQAlwmqc88/TYNi3VfUf0I/AAAAAAAAANM/EZIWQUDwcBI/s72-c/Screen%2Bshot%2B2011-03-18%2Bat%2B2.46.40%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-7264888008963081793</id><published>2010-02-25T05:38:00.000-08:00</published><updated>2011-03-22T06:51:07.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='subtemplate'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='templates'/><title type='text'>From HTML to XML and beyond!</title><content type='html'>What happens if you need to deliver same content but in different format? Sure you don't want to duplicate content. Well Magnolia CMS provides a feature that with little work lets you deliver same content in any format you need, it could be xml, or even html but optimized for newsletters.&lt;br /&gt;&lt;br /&gt;How to do this? You need to select a template definition and add sub templates like in the image below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vxmdCE2p3O0/S4aASkZ7KLI/AAAAAAAAALk/Yy-5_4vksN0/s1600-h/Picture+15.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 118px;" src="http://2.bp.blogspot.com/_vxmdCE2p3O0/S4aASkZ7KLI/AAAAAAAAALk/Yy-5_4vksN0/s320/Picture+15.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5442178256222234802" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This sample is using Magnolia CMS version 3.6 (feature also available for 4.x) with just one sub template defined that will render as xml when I request the page as url.xml and rendered as html when requested as url.html.&lt;br /&gt;&lt;br /&gt;Because at the moment, sub templates do not work for paragraphs, in the template file that generates the xml content we will have to iterate through the paragraphs.&lt;br /&gt;&lt;br /&gt;In my sample I used jsp, so I iterated main collection within a scriplet, by first getting the active page and then its children:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Content actPage = Resource.getActivePage(request);&lt;br /&gt;if(actPage.hasContent("mainColumnParagraphs")) {&lt;br /&gt; //some code&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When using freemarker there is no need to use java:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;[#list content.main?children as para]&lt;br /&gt; [#assign paragraphContent=para]&lt;br /&gt; [#if para.metaData.template='mgnlTextBox']&lt;br /&gt;   [#include "textBox.ftl" ]&lt;br /&gt; [/#if]&lt;br /&gt;[/#list]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of my use cases was to generate a newsletter template for the web and a simpler one that would be supported by the mail clients.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-7264888008963081793?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/7264888008963081793/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2010/02/from-html-to-xml-and-beyond.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/7264888008963081793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/7264888008963081793'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2010/02/from-html-to-xml-and-beyond.html' title='From HTML to XML and beyond!'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vxmdCE2p3O0/S4aASkZ7KLI/AAAAAAAAALk/Yy-5_4vksN0/s72-c/Picture+15.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2158598821071141596.post-8802375208709635327</id><published>2010-02-25T01:02:00.000-08:00</published><updated>2011-03-22T06:53:29.778-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magnolia'/><category scheme='http://www.blogger.com/atom/ns#' term='auto generate'/><category scheme='http://www.blogger.com/atom/ns#' term='magnolia_cms'/><category scheme='http://www.blogger.com/atom/ns#' term='stk'/><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>Auto generate paragraphs</title><content type='html'>By default Magnolia CMS STK comes with a mechanism to auto generate paragraphs in main and extras areas. This is very useful when you have the need of a paragraph to be present in all pages using some template. That paragraph could be modifiable or not and could be initialized with some default parameters or not.&lt;br /&gt;&lt;br /&gt;If we have a look at the class SingletonParagraphTemplateModel, we can see that in the execute method has two method calls, one to generate a single paragraph in the main area (see stkSiteMap template) and the other one to generate any number of paragraphs in the extras area.&lt;br /&gt;&lt;br /&gt;See below the template configuration for the main area auto generated sitemap paragraph&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vxmdCE2p3O0/S4ZKvWQ2UzI/AAAAAAAAALM/zk84qQ1Hgpg/s1600-h/Picture+13.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 131px;" src="http://4.bp.blogspot.com/_vxmdCE2p3O0/S4ZKvWQ2UzI/AAAAAAAAALM/zk84qQ1Hgpg/s320/Picture+13.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5442119377014379314" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nice thing is that you can extend this class or implement your own to generate any paragraph in any area of the page.&lt;br /&gt;&lt;br /&gt;Below is the template configuration for the extras area auto generated paragraphs.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vxmdCE2p3O0/S4ZMcJnb7wI/AAAAAAAAALc/gWyq97Ee4iY/s1600-h/Picture+14.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 131px;" src="http://4.bp.blogspot.com/_vxmdCE2p3O0/S4ZMcJnb7wI/AAAAAAAAALc/gWyq97Ee4iY/s320/Picture+14.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5442121246225198850" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2158598821071141596-8802375208709635327?l=tmiyar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmiyar.blogspot.com/feeds/8802375208709635327/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://tmiyar.blogspot.com/2010/02/auto-generate-paragraphs.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/8802375208709635327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2158598821071141596/posts/default/8802375208709635327'/><link rel='alternate' type='text/html' href='http://tmiyar.blogspot.com/2010/02/auto-generate-paragraphs.html' title='Auto generate paragraphs'/><author><name>Teresa Miyar</name><uri>http://www.blogger.com/profile/04763321910064824253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_vxmdCE2p3O0/S4ZKvWQ2UzI/AAAAAAAAALM/zk84qQ1Hgpg/s72-c/Picture+13.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
