{"id":3235,"date":"2011-03-10T20:34:46","date_gmt":"2011-03-10T15:04:46","guid":{"rendered":"https:\/\/2thenew.today\/blog\/?p=3235"},"modified":"2017-05-01T12:56:15","modified_gmt":"2017-05-01T07:26:15","slug":"a-simple-read-moreless-grails-tag","status":"publish","type":"post","link":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/","title":{"rendered":"A simple Read more\/less grails tag"},"content":{"rendered":"<p>Hello world.. In a pretty recent project, I was a given a task to implement &#8220;read more&#8221; custom tag to implement &#8220;read more&#8221; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad job and implemented the tag in a quiet dirty way. Later I found some time to work on it and end up creating something way better than previous effort \ud83d\ude00<\/p>\n<h3><b><span style=\"text-decoration: underline;\">Read More\/Less tag<\/span><\/b><\/h3>\n<p>It is a pretty simple tag in which you pass a block of text and in return you get the text &#8220;read more\/less&#8221;-ified (Ok! I know thats bad :P). Anyways, now for this tag to work, Jquery is required.<\/p>\n<h3><b><span style=\"text-decoration: underline;\">Tag syntax<\/span><\/b><\/h3>\n<p>Just enclose the block of text inside the &#8220;readMore&#8221; tag and you are done.<\/p>\n<p>[java]<br \/>\n&amp;lt;ls:readMore&amp;gt;${myText}&amp;lt;\/ls:readMore&amp;gt;<br \/>\n[\/java]<\/p>\n<h3><b><span style=\"text-decoration: underline;\">Output<\/span><\/b><\/h3>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3242\" src=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_1.png\" alt=\"Blog image\" width=\"320\" height=\"38\" \/><\/a><\/p>\n<p>After clicking the read more\/less&#8230;<br \/>\n<a href=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3245\" src=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_2.png\" alt=\"Blog image\" width=\"320\" height=\"125\" \/><\/a><\/p>\n<p>This tag can be used to create multiple &#8220;read more&#8221;s like following:<br \/>\n<a href=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3250\" src=\"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_3.png\" alt=\"Blog image\" width=\"320\" height=\"314\" \/><\/a><\/p>\n<p>I believe there is still room for improvement in tag and will try to bring in as much as possible . You can download the code from the following link and play around with it if required. Feel free to advice me on how can I improve the tag or you can come up with your own improvements. Ciao<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello world.. In a pretty recent project, I was a given a task to implement &#8220;read more&#8221; custom tag to implement &#8220;read more&#8221; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3235","post","type-post","status-publish","format-standard","hentry","category-grails"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello world.. In a pretty recent project, I was a given a task to implement &quot;read more&quot; custom tag to implement &quot;read more&quot; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Partho Ghosh\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"A simple Read more\/less grails tag | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello world.. In a pretty recent project, I was a given a task to implement &quot;read more&quot; custom tag to implement &quot;read more&quot; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"A simple Read more\/less grails tag | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello world.. In a pretty recent project, I was a given a task to implement &quot;read more&quot; custom tag to implement &quot;read more&quot; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#article\",\"name\":\"A simple Read more\\\/less grails tag | TO THE NEW Blog\",\"headline\":\"A simple Read more\\\/less grails tag\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/partho\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2011\\\/03\\\/readMore_op_1.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#articleImage\"},\"datePublished\":\"2011-03-10T20:34:46+05:30\",\"dateModified\":\"2017-05-01T12:56:15+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#webpage\"},\"articleSection\":\"Grails\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#listItem\",\"name\":\"A simple Read more\\\/less grails tag\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#listItem\",\"position\":3,\"name\":\"A simple Read more\\\/less grails tag\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/partho\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/partho\\\/\",\"name\":\"Partho Ghosh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/38d4902e2814dd69795605522c92c38e8590ded97aacba499cda3ce5fb5ae04b?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Partho Ghosh\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/\",\"name\":\"A simple Read more\\\/less grails tag | TO THE NEW Blog\",\"description\":\"Hello world.. In a pretty recent project, I was a given a task to implement \\\"read more\\\" custom tag to implement \\\"read more\\\" functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/a-simple-read-moreless-grails-tag\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/partho\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/partho\\\/#author\"},\"datePublished\":\"2011-03-10T20:34:46+05:30\",\"dateModified\":\"2017-05-01T12:56:15+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"A simple Read more\/less grails tag | TO THE NEW Blog","description":"Hello world.. In a pretty recent project, I was a given a task to implement \"read more\" custom tag to implement \"read more\" functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad","canonical_url":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#article","name":"A simple Read more\/less grails tag | TO THE NEW Blog","headline":"A simple Read more\/less grails tag","author":{"@id":"https:\/\/2thenew.today\/blog\/author\/partho\/#author"},"publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2011\/03\/readMore_op_1.png","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#articleImage"},"datePublished":"2011-03-10T20:34:46+05:30","dateModified":"2017-05-01T12:56:15+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#webpage"},"articleSection":"Grails"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.today\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/2thenew.today\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#listItem","name":"A simple Read more\/less grails tag"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#listItem","position":3,"name":"A simple Read more\/less grails tag","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.today\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.today\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.today\/blog\/author\/partho\/#author","url":"https:\/\/2thenew.today\/blog\/author\/partho\/","name":"Partho Ghosh","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/38d4902e2814dd69795605522c92c38e8590ded97aacba499cda3ce5fb5ae04b?s=96&d=mm&r=g","width":96,"height":96,"caption":"Partho Ghosh"}},{"@type":"WebPage","@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#webpage","url":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/","name":"A simple Read more\/less grails tag | TO THE NEW Blog","description":"Hello world.. In a pretty recent project, I was a given a task to implement \"read more\" custom tag to implement \"read more\" functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.today\/blog\/author\/partho\/#author"},"creator":{"@id":"https:\/\/2thenew.today\/blog\/author\/partho\/#author"},"datePublished":"2011-03-10T20:34:46+05:30","dateModified":"2017-05-01T12:56:15+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.today\/blog\/#website","url":"https:\/\/2thenew.today\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"A simple Read more\/less grails tag | TO THE NEW Blog","og:description":"Hello world.. In a pretty recent project, I was a given a task to implement &quot;read more&quot; custom tag to implement &quot;read more&quot; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad","og:url":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/","og:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"A simple Read more\/less grails tag | TO THE NEW Blog","twitter:description":"Hello world.. In a pretty recent project, I was a given a task to implement &quot;read more&quot; custom tag to implement &quot;read more&quot; functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad","twitter:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"3235","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 13:50:40","updated":"2024-02-29 08:54:26","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\/category\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tA simple Read more\/less grails tag\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.today\/blog"},{"label":"Grails","link":"https:\/\/2thenew.today\/blog\/category\/grails\/"},{"label":"A simple Read more\/less grails tag","link":"https:\/\/2thenew.today\/blog\/a-simple-read-moreless-grails-tag\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/3235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/comments?post=3235"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/3235\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/media?parent=3235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/categories?post=3235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/tags?post=3235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}